Rafael Nadal contemplated a move into golf after suffering a career-threatening injury that left him devastated and "without appetite for life", the 10-times grand slam champion has revealed in his autobiography.

The Spaniard writes in Rafa that doctors discovered a rare foot injury in 2005 that had the potential to sideline him for good, prompting thoughts of a future in golf.

In the book, to be released in the US on Tuesday, the 25-year-old Nadal describes his toughest on-court battles with Roger Federer at the 2008 Wimbledon final and subsequent Australian Open. But his off-court problems play a large part in the former world No1's career. The mental toll of his parents' separation hindered his recovery from injuries in 2009, when pride led him to try to defend his French Open title despite his physical problems.

Still, his lowest point seems to have been when doctors discovered a congenital bone problem in the bridge of his left foot soon after a five-set victory over Ivan Ljubicic in Madrid on his toughest indoor surface. Nadal said that joy was soon replaced by "a state of deepest gloom".

"[The] diagnosis had initially been like a shot to the head," Nadal writes. "The bone still hurts me. It remains under control, just, but we can never drop our guard."

Nadal wept then just as he did after losing the 2007 Wimbledon final to Federer. But he did not cry on the flight from Melbourne in 2009 when his father Sebastian revealed to the recently crowned Australian Open champion that his parents had separated.

"My attitude was bad. I was depressed, lacking in enthusiasm. [My team] knew something had to give," writes Nadal, with the weight of those problems leading to his only defeat in seven appearances at Roland Garros and his subsequent withdrawal from Wimbledon. "My knees were the immediate reason but I knew the root cause was my state of mind."

Mental toughness – instilled by his coach and uncle Toni – is a key theme, especially in his ability to bounce back, including trying for his first victory in three Wimbledon finals against Federer. Nadal was "gripped with fear", the warrior figure he had cultivated had "lost his courage" after failing to clinch victory on several match points against Federer. Nadal credits moments such as these for improving his mental stamina, with one chapter titled Fear of Winning.

"What I battle hardest to do in a tennis match is to quiet the voices in my head, to shut everything out of my mind … should a thought of victory suggest itself, crush it," Nadal writes on the opening page before later adding: "I think I have the capacity to accept difficulties and overcome them that is superior to many of my rivals."

Toni's "cruel to be kind" coaching strategy was key in developing him into the "tennis machine" he is, comparing his uncle to a figure descended from the 16th-century conquistador Hernán Cortés with a Spartan philosophy of life uncommon to his home island of Mallorca.

"There was no let-up from Toni. No mercy," the world No2 writes. "I look back at that teenage Rafael and I am proud of him. He set a benchmark of endurance that has served me as an example and as a reminder ... if you want something badly enough, no sacrifice is too great."

Nadal offers some surprising details in the 250-page memoir. Nadal's mother Ana María Parera labels him a "scaredy cat" who sleeps with a light on; an obedient and docile child who became the "family mascot" inside a close-knit family that Carlin describes as "something Sicilian … without the malice or guns".

Of Federer there are mostly respectful reflections of a rival and friend that he calls "a blessed freak of nature" for his talent. The closest Nadal comes to criticism is when he says Federer mis-hit a shot "the way an ordinary club player might" while recounting the epic All England final that delivered the first of his two Wimbledon wins in 2008. Of the top-ranked player Novak Djokovic, who has beaten Nadal in five straight finals this year, there is trepidation of a "formidable opponent" who is "one hell of a player, temperamental but hugely talented".