I've been to Rio during a personal tour of South America. It is dangerous even though I'm used to travelling alone, and in remote/dangerous places. I would be a bit doubtful about taking younger children there for 5 days; having said that, if they're fascinated by such places and mature enough to understand the need to be careful as "a bit of an adventure", it could work.
Tourists are an absolute target, so don't look like one. Also, no watches, no jewellery, no money on show (hidden money belts) keep your camera hidden unless taking photos. No phones on show. Everything will get snatched. The standard thinking is "tourists must be rich to come here" regardless, so they will think nothing of pulling a knife and holding it to the throat to make you hand over anything you have. You are very unlikely to actually get harmed though....although it has been known. A large, safe beach in the daytime would be fine, it's packed with locals, don't be out in the dark ANYWHERE and not even late afternoon or evening on the beach.
Choose a hotel on the beach front, the more expensive the better....they often have lots of things to do within the hotel complex (many have inner gardens and pools) and most have fabulous rooftop views.
As other pp have said, you will get by, but there isn't as much English spoken as you'd expect. Brazilian Portuguese is difficult to understand and having some Spanish won't help you. I found the Brazilians have a slightly contemptuous attitude towards the British, in contrast to Argentinians who (given our past with Argentina!) are generally welcoming towards us.
Use a proper tour guide for everything, it costs but it's safe. They will take you to all the sights....Christ the Redeemer is lovely but packed with tourists trying to stand like the statue 'with a backdrop' for their selfies....that put me off. Lovely views though, the sea is blue, the mountains and islands beautiful. Sugar loaf fine, not so interesting. Cable car rides over the favelas. Botanic gardens not exactly Kew but you can see amazing flowers, parakeets everywhere and the butterflies and insects were amazing too. Lots of leaf cutter ants carrying flower petals to their nests, it was like being in an Attenborough documentary...children would be fascinated.
A proper tour guide will collect you by car from your hotel and take you to further afield places....museums, opera houses, art installations. They will talk about the culture, the people, the history....cars for tourists often have blacked out windows so that the locals can't see who is inside, it's safer. They also have an unnerving way of driving right up the pavement and parking exactly in front of your hotel door so you can get out without walking along the street - also considered safer. I remember having a car to take me to the airport so my bags were in the boot. We stopped at the local market to have a look round (absolutely fascinating, acres of bananas, brazil nuts and fish etc.) but the visit cost me money....when the driver parked the car he had to pay locals to watch over the car so it wouldn't get raided by gangs while we walked round! This is normal wherever you go.
Oh, and the traffic is extraordinary. The famous beach is glorious but there is a road alongside which is full of stop-start fume-chuffing traffic....getting about takes ages because of the traffic.
The most fascinating trip was a local lass who took me into the favelas, they are dreadful, horrifying and utterly fascinating places. Extremely dangerous even with a guide (who has usually grown up in the favelas - ours had had healed gunshot wounds on her shoulders and she was only in her 20s). For a perspective on life, I would describe my visit and what I saw/learned was life-changing but it's not for children, most definitely.
Good luck with your holiday. I would say if you go, it can certainly be done but view it from an experience point of view rather than wanting a relaxing holiday. Go with your eyes open and take the precautions, it would be an experience for your children if you did it wisely.