Brazil is a hot and humid country. Hydration and sun protection should be planned to avoid spending your holiday in a hospital bed. Most water bought in shops is safe and clean, although some of the "camelos" (street vendors) do cut corners and re-fill plastic bottles with tap water. Do not accept a bottle that is not properly sealed. Most vendors will refund your money if you ask with a smile.
Only buy water from the boys that swarm the bus windows as it pulls in and out of the station, in an extreme emergency. Do not expect any change, nor quality.
The 100 percent sure-fire way to avoid any tummy problems is to stick to coconut water, which is full of calcium and potassium. In the Northeast of Brazil, it is a staple and the most refreshing drink. Babies are often put on diets of "Agua de Coco" by doctors to beef them up. If you can't belly the taste of coconuts, then go to one of the kiosks that are omnipresent and order a fruit drink. For less than $2, you can choose a mix of mango, banana, papaya, acerola, guava, just to name a few, which they will blend in front of you and serve in an ice-cold glass.
If you want to hear the beauty of the Brazilian-Portuguese ask the juicer to list the fruits; the sounds are almost as good as the tastes.
Brazil can be very remote. Areas of the Amazon, the Northeast and the deep interior are still not developed for tourism. Although you will see the locals putting their thirsty mouth under a tap or city fountain, don't be tempted. If you are camping, boil your water. If you are staying for a long time, introduce the water into your system little by little. The fruit and vegetables that you buy should always be thoroughly washed.
In general, Brazilians take their personal hygiene very seriously. The locals restaurants and hotels will bend over backwards to make sure you will return, as long as you say everything with a smile.