Ricky Berens has raced for the final time. Berens, who is 24 years old, won gold in the 4x200m freestyle relay on Tuesday night and now he has had enough. "I'm done," he told the press, explaining that has not had more than two weeks off since he was in high school. It is not unusual. Swimmers tend to retire early – Michael Phelps will retire soon and he is only 27. Berens, like Phelps, wants to find out what the world is like when you do not spend five hours a day ploughing up and down a pool, six days a week. Berens's first stop? McDonalds, where he took down a Big Mac, a quarter pounder and a portion of fries. After that, he wants take a masters in sports management.

Well, that is one way of doing it. There are other paths too, like the one taken by Berens's USA team-mate Anthony Ervin. You may remember Ervin. He won gold in the 50m freestyle back in Sydney in 2000, tying in a dead heat with the great Gary Hall Jr. Ervin was only 19 at the time. The next year he won the sprint double at the World Championships in Fukuoka. It was not long after that he decided he wanted to see a little more of what life had to offer. "When you strive for something and do well, it's always going to be a double-edged sword," Ervin explained. "You reach your goals but you get cut in the process." He did one more major competition – the Pan Pacific Swimming Championships in 2002 – and then he dropped out, from stardom, from sport and from Berkeley, where he had a swimming scholarship.

Pretty much the first thing he did was sell his Olympic gold medal on eBay, for $17,101. He gave the money to Unicef. "In order to kind of cleanse myself," he told The Star Tribune, "I wanted to do something I thought would help, to kind of give myself away."

In the next eight years, Ervin grew some dreadlocks, played lead guitar in a heavy metal band called Weapons of Mass Destruction, took a job in a record shop, and another in a tattoo parlour, became an alcoholic, experimented with hallucinogens, fractured his shoulder on a motorcycle while he was trying to escape from the police, tried to kill himself with a tranquilliser overdose, spent time studying Sufism became a committed Buddhist and, finally, went back to Berkeley to complete a degree in English.

Now, twelve years on, he has come full circle. At the age of 31 he is back for his second Olympics, swimming in his favourite event, the 50m freestyle. He will be in the final on Friday night, having been third-fastest in the semi-final. Afterwards, he bounded up to the press in the mixed zone, his hair a messy tangle of curls, his eyes bright with excitement behind a pair of clear Ray-Ban sunglasses, his arms swathed in long, swirling, dragon tattoos.

So how does it feel to be back, Anthony? "You know," he said. "Twelve years was a long time ago. It may be the same kind of venue and I may be working with the same kind of institution but I have grown a lot over the last 12 years. The difference between then and now? I don't even know, it is hard to explain."

Ervin, it would be fair to say, took a unorthodox route to these Olympics. But then he always was a little different. His parents enrolled him in a swimming class because, he told Rolling Stone recently, "I was a little shit. A troublemaker, disobedient, no discipline." He started winning races but he hated it. He was always running away from home trying to duck out of lessons and training sessions. Soon enough he was diagnosed with Tourette syndrome and started taking heavy tranquillisers. It did not slow him down. By his senior year he was ranked second in the USA for his age group, which is how he got that scholarship. He even turned it to his advantage, playing around with his dosages, trying to make himself as aggressive as possible because he thought it would give him an edge in the pool.

After his gold medals in 2000 and 2001, things began to fall apart. He started drinking more, taking more recreational drugs. He once woke up in jail with no idea how he got there. A succession of one night stands meant that he began to see women as "objects to destroy at will," he told Rolling Stone. "There were so many phases of casual sex, which now seems repugnant." Depression struck deep. Soon after he tried to take an overdose and "woke up the next morning only to find I had failed to even kill myself." After that, he remembers thinking: "If I can't destroy myself, maybe I can't be destroyed." He began to collect tattoos because "after being forced to constantly abuse my body with labour ... I was also reclaiming my body with the tattoos. I was giving myself a new skin. I wanted to re-create myself."

Soon after, stony broke, Ervin took a job at a swimming school set up by a friend of his. There, among kids who did not take things too seriously, he began to rediscover his love for the sport and straighten himself out. "My real bane was smoking pot and cigarettes," he says. "It's really been my Kryptonite." Buddhism helped him too. He had grown sick with other people's attempts to put labels on him. Ervin is half black, half Jewish and he found himself labelled as the "first swimmer of African-American descent to make the US team". He hated it, "I didn't know a thing about what it was like to be part of the black experience," Ervin says. "But now I do. It's like winning gold and having a bunch of old white people ask you what it's like to be black. That is my black experience."

Ervin re-enrolled at Berkeley in 2007. He was still struggling with depression and he started training seriously again in 2010 in an attempt to cure another attack of it. The university swimming coach, Teri McKeever, told him she would take him back on the program if he enlisted in the U.S Anti-Doping Agency's drug testing program. He did and soon his times were good enough to put him in contention for a spot on the US team. And at the US trials this summer, he finished second in the 50m freestyle, in a new personal best of 21.60sec. These days he says the pool is a sanctuary for him, when "for most of my youth. It was a prison."