"I have to make sure that I take care of my schedule, my body, my mind," the Swiss World No.2 was quoted as saying by Xinhua Thursday.
"Hopefully I can still stay on tour for many more years and hopefully play the Olympics here in three and a half years or so, so I have to look far ahead and not just the next six months.
"There is a lot of passion for sports here. It's a hot place to play tennis right now."
Federer is in Sao Paulo for an exhibition tournament also involving Maria Sharapova, Victoria Azarenka, Serena Williams, Caroline Wozniacki, Jo-Wilfried Tsonga, Tommy Robredo, Tommy Haas and Thomaz Bellucci.
The 17-time Grand Slam winner has competed in four Olympics, winning doubles gold in 2008 and singles silver this year. Federer, who played 21 tournaments in 2012 - more than any of his top four rivals - said quality rather than quantity would be the key to his future.