Ah, yes, Rio, the home of Copacabana beach, samba, thongs, the girl from Ipanema and … what's that? A pair of stout hiking boots? Hmm.

When I looked at my packing for my trip to Rio de Janeiro, one of the most exciting cities in one of the most exciting countries on Earth, famed for its beaches and its nightlife, it seemed just a bit wrong. Most people go with a Barry Manilow CD and, if it's carnival time, maybe a sequined headdress. I, on the other hand, appeared to have packed for a weekend in Snowdonia.

But then there's every possibility that a hiking holiday in Rio was one of my less good ideas. I was encouraged by a website called Rio Hiking, which lured me in with exciting descriptions of scaling Sugar Loaf and Corcovado, of rafting rivers, rappelling waterfalls and forging paths through rainforest, but they failed to answer my emails. And when I did a bit of research before I left, there were other not entirely reassuring signs.

"Walking up to Corcovado is not recommended," I read on another site, "owing to frequent robberies." And then there's the Tijuca forest, the world's largest urban forest, 46 square miles of it, right in the middle of Rio, home to rivers, birds, mountain peaks and some of the best urban hiking anywhere. Lonely Planet waxed lyrical about it, right up to the last sentence: "Warning: there have been occasional reports of armed robberies within the park."

When I looked up Santa Teresa, where I'd booked my hotel, supposedly a charming area of crumbling mansions on a hill above the city, it said: "Do take care when walking around, day or night, because muggings are not uncommon." Hiking in Rio, I started to think, was a bit like deciding to take a relaxing beach holiday in Libya or a stroll through Guantánamo Bay, ripe with possibilities for bird-watching, wildflower-spotting and being held up at gunpoint. I didn't want to stay at the beach in a tourist ghetto, but before I left for my flight I looked up my hotel, Casa 579, on Google Maps and found it nestling up to Favela Julio Otoni, just below Favela Cerro-Corá, and spitting distance from Favela Morro dos Prazeres, Favela Morro do Escondidinho, Favela Morro Santa Marta, Favela Vila Candido and Favela Guararapes. Which, to my inexperienced eye, seemed like an awful lot of favelas.

But then, as I discovered on my first morning, the favelas have the best views. Waking at dawn, after arriving in the dead of night, I felt like I was still on a plane: out of my window I gazed across the valley to Corcovado, down to Sugar Loaf, across lushly wooded hills to the sea sparkling beyond. Casa 579 is only a guesthouse, but it has views better than any five-star hotel – and the added benefit of Teresa, a dynamic Englishwoman who prides herself on steering her guests away from the tourists traps towards the real Rio. She had a robust attitude when I grilled her on Lonely Planet's advice against walking up Corcovado to the Christ the Redeemer statue. "Nah," she said. "I do it all the time."

But what about all the favelas? I said. "You just go past them," she said. "You don't go into them. Unless you get lost."

I also took reassurance in the fact that Brazil's economy is booming and that even the favelas are supposed to be feeling the effects these days.

It's a two-hour climb to Christ the Redeemer from Santa Teresa. There's a path, but I stuck to the road, which wound its way past the favelas, with glimpses down to Sugar Loaf, the islands and sea beyond, and into the forest, with its huge, old breadfruit trees and the kind of plant life I'd only ever seen in the 1970s. I spotted a spider plant – any minute now, I thought, I'd see a macramé pot-holder and a wife-swapping ring. Finally, I reached the symbol of Rio itself, the Cristo, where I was joined by the crowds who'd taken the funicular or minibus. Ha! What slack-arses, I thought. Although it has to be said that they were looking distinctly more crisp and cool than I was.

Still, from this vantage, what is one of the greatest cities in the world barely even looked like a city. It's half city, half mountainous jungle. And against the cliffs, rocks and hills, the buildings looked so insubstantial – as though all it would take was a slight shift in the earth's crust and the forest would re-engulf the high-rises and shantytowns, and reclaim the land. It's just not like London or Moscow or New York or almost anywhere else, flattened by tarmac, encased in concrete, corralled into what we call civilisation.

Nature in Rio is bigger, bolder, too powerful a force. Driving down an avenue near the Botanic Gardens later, and the buildings suddenly disappeared, the jungle pressed in overhead, and in the School of Visual Arts, a stunning Italianate villa in the Parque Lage, I sat in a cloistered cafe next to a courtyard pool, beneath a towering cliff face, the drone of the traffic the only indicator that I was still in a conurbation, not lost in a forgotten city in the middle of the Amazon.

With my guide Paulo, I tackled the Pico da Tijuca, the second highest point in the city at 1,022m (Pico da Pedra Branca is just higher at 1,025m). It's a pointy peak in the middle of the Tijuca forest, the last portion of which involves a steep ascent up steps cut into the bare rock, hanging on to an iron chain. There was no one around, it was a weekday, and the locals were at work and the tourists were in Copacabana, basting on the beach. Mad, I thought. Up here, the air was fresh and the light clear, the forest full of shady dells and cooling waterfalls. And yet, a couple of hours later, I was having caipirinhas amid the faded grandeur of Lapa, the newly fashionable barrio beneath Santa Teresa.

The next day, venturing a little further afield to Ilha Grande, I thought I might have cracked it. The most beautiful beaches in the world (literally, that is: Lopes Mendes on the island's ocean side is consistently voted into the world's top 10) and great hiking. It's where Cariocas, as the locals are called, come for the weekend, and it's just a short hop, skip and a jump away from Rio, or as pedants would have it, a bus ride and then a boat, but it's idyllically pretty, traffic-free and barely developed, with empty beach after pristine beach. It was a quarantine station and then a prison, Brazil's Alcatraz, maximum security, until 1994, which saved it from both mass tourism and millionaires. It's easy enough to walk the coastline, but when it comes to climbing the peak, Rodolfo and Claudia, the helpful couple who run the Sudoeste SW tourism office, told me I really had to take a guide and rustled up Tico.

"The vocation of the islands is eco tourism," Rodolfo told me, with a touch of despair. "But people just want to lie on the beach!" I liked the idea of an island with a vocation – all islands should have one, surely – and Tico took great pleasure in instructing me in the difference between primary and secondary Atlantic rainforest (simpleton that I am, I thought all forest was good, but Tico tut-tutted every time we passed a coconut palm), and even more pleasure in skipping up the 990m Pico do Papagaio while I lumbered behind. He'd been coming to the island on holiday since he was a boy, and while we had to pass a cliff face studded with vipers' nests, in the early 90s there were escaped murderers to contend with.

And then, finally, the forest broke and, after the final haul up a rock face, the view. Of forest and sea and mountains, and powdery white beaches. Rio: it wasn't quite a hiking holiday, but it has to be said it wasn't much like a city break either.

Carole Cadwalladr; the Guardian

Tailor-made holidays

Flexible, custom-made holidays to Latin America created to match your exact requirements: our tailor-made itineraries are as unique as the clients for whom they are designed.

Design my trip