Hi
This is entirely unproblematic. A SIM card ("une puce") costs the equivalent of around two euros and can be bought in any town where the company has coverage, which is as good as any town of any size these days. You may be asked to present your passport when buying it, but that's the limit of bureaucracy.
Recharges or prepayment cards ("crédit") can be bought in small or large units as required at any number of outlets up and down the country.
You should choose either Orange or Zain (successor to Celtel/Madacom - names it is still known by in some places) as provider, as other providers (e.g. Telma) have a much more limited coverage.
Most of the outlets selling recharges don't sell SIM cards, and you may need to go looking. There's usually a stall selling Zain SIM cards outside the Shoprite store off the Avenue de l'Independence, and you can get an Orange SIM at a shop about 100 metres up the road from the Sakamanga Hotel.
Prerequisite for everything of course is that your mobile doesn't have a SIM lock.
When buying your SIM card, ask them to set it so that information messages are sent to you in French, not Malagasy.
If for any reason you need to make landline calls, do it from a post office - the few public kiosks are either chronically out of order or you need to get a prepaid card from somewhere to use them.