Rio gets a lot of bad international press about its high crime rate and balas perdidas (stray bullets) - but don't let this stop you from coming. Travelers to Rio have as much chance of getting mugged as in any other big city, so the same precautions apply. If you're sensible when visiting the city, you'll probably suffer nothing worse than a few bad hangovers. All the same, theft is not uncommon, and you should do what you can to minimize the risks of getting robbed.
Buses are well-known targets for thieves. Avoid taking them after dark, and keep an eye out while you're on them. Catch taxis at night to avoid walking along empty streets and beaches.
Beaches are the most common places for robbery. A common beach scam is for one thief to approach you from one side and ask you for a light or the time. While you're distracted, the thief's partner grabs your gear from the other side. Copacabana and Ipanema beaches are safer than others, owing to their police presence, but don't get complacent. Don't take anything of value to the beach, and stay alert - especially during holidays when the shore gets packed. Late at night, don't walk on the beach - stay on the sidewalk - and if you're in Copacabana, it's wise to keep to the hotel side of Av Atlântica rather than the beach side.
Get in the habit of carrying only the money you'll need for the day, so you don't have to flash a wad when you pay for things. Cameras and backpacks also attract a lot of attention. Consider using disposable cameras while you're in town; plastic shopping bags also nicely disguise whatever you're carrying.
Maracanã football stadium is worth a visit, but take only spending money for the day and avoid the crowded sections.
Don't wander into the favelas (shanty towns) at any time, unless you have a knowledgeable guide. If you have the misfortune of being mugged, hand over the goods. Thieves in the city are only too willing to use their weapons if given provocation.