Tipping isn’t deeply established in Madagascar. When you’re living and travelling among Malagasy people, you’ll be unlikely to feel the need to tip anyone: cheap hotels and restaurants are often run by their owners, using family staff, and when travelling by taxi brousse, it’s more a matter of ensuring you’re not paying over the odds for your seat or bag than of considering leaving any extra. The idea of a payment for services rendered is quite common, however, so any kind of assistance, such as someone showing you the way or helping with luggage (notoriously, when arriving at the airport and fending off unwanted “porters”) would normally demand some kind of recompense. Keep some small notes (200ar, 500ar) handy for this kind of thing.
When travelling more as a wealthy tourist, staying at expensive resort-style hotels for example, it’s best to leave a common tip at the end of your stay with reception or in the tip box in the foyer. You would probably also do the same when parting company with your driver at the end of a tour. Guides in national parks don’t always expect tips, but an extra 5000ar after a few hours of trekking and lemur-watching is a very acceptable way of offering thanks.