On some beaches skimpy outfits are the norm, while on other beaches, especially in the south, the dress and swimwuits tend to be more conservative so try to stick with shorts or short-sleeved shirts that aren't too revealing. Moving away from the beaches and further inland the dress generally becomes more conservative. In most places shorts are uncommon as the people tend to wear simple shirts, slacks, and perhaps even a sweater for colder weather.
As a visitor to Brazil you can wear just about anything without offending the locals, but do cover up when not on the beaches, especially if visiting churches. Also be ready for rain as much of the country is covered with rainforests and the rains can arrive any time of year throughout the country. If going out or doing business in the country, the Brazilians tend to dress quite formally and you should follow suite as how a person dresses tends to indicate status and the respect you will receive as a result. Women should also take care to have their nails done as this will be notice, or at least not having them done will be noticed.
Although dressing nicely for business and meals out is important, also try to avoid dressing in a way that indicates wealth or attracts excessive attention. Wearing shirts that indicate you are foreign or wearing a flashy watch are great indications that you are from out of town and in many places this is an invitation to potential criminals. Also try to avoid wearing the colors of the Brazilian flag, which are green and yellow, particularly in business settings.