This topic is discussed often on Tripadvisor forums, but I wanted to add my two cents after benefiting from so many others' writings on this forum. My wife and I [early 30s] recently returned from a week in Rio [Trip Report forthcoming]. We live in Los Angeles and this was our first trip to South America, so I relied heavily on reports posted in this space. Based on certain posts, you would think you were walking into a warzone! Nothing could be farther from the truth. In fact, I didn't feel unsafe at any point while in Rio, though I can understand guide book recommendations against wandering around in Lapa during the day since it does have a seedy feel to it.
To be clear: We were staying in Leblon, which is a very nice area where security is not an issue. We walked from Leblon to Copacabana during day with no issues and walked around Leblon at night with no problems. [I only mention these unremarkable facts because so many people recommend taking cabs for the shortest of distances.] The metro was safe and clean as well. In many ways, safety/security in Rio compared favorably to Los Angeles. That's not to say that there aren't pockets of questionable blocks, but you get that in any city.
I would venture to guess that Rio's reputation for tourist crime comes primarily from the fact that so many tourists stay in Copacabana. Ipanema and Leblon seem nicer and other areas like Niteroi and Botafogo seem more democratic and less touristy.
One post in this space made a big deal of the fact that Rio police/guidebooks/etc. recommend against walking alone on the beach at night. To put this in perspective, I heard the same thing from locals in Oahu.
Rio is fantastic. I can't wait to go back.