Topless sunbathing is a crime in Brasil. Although there might be topless beaches somewhere (I didn't find any, damn!), being topless at a beach can get you a ticket. So avoid it. You can wear really small bikinis and g-strings (as all brazilian girls do), but no topless.
Drinking in public places is not a crime in Brazil. You can drink on the street and you won't have problems. So don't get fooled by policemen that are trying to get some money out of you because of this: it is legal to have a beer while you talk to a policeman. What is not it to drink while you drive. Don't get confused!!!