It should be mentioned Connors won 20 titles past 30, so if Federer wants to get 29 more he would have to do something beyond incredible and win more titles than the marathon man Connors who went around the world and played in really small venues, something Federer just wouldnt do. Laver won 42 titles past 30 but that was clearly another era and Laver played alot of very small venues aswell.
that is just it. its either win small events and keep your ranking high for the bigger events or win nothing and drop like a rock in the rankings.
and that would certainly force him into retirement. rosewall stuck around for a long time as well. it was a testament to his fitness and his desire to stay involved in the sport.
remember that we have a lot of players on the tour already who are in their 30`s: ljubicic and dr ivo come to mind instantly.
and there are others. ferru must be 30 and he is ranked #5. and that dude has no weapons at all.
finally there are other possibilities: if you really want to compete until 40 and do reasonably well and you have the talent, you can always get more involved in doubles. 35-37 today is nothing in doubles.
average player cant do this but beasts like physical nadal, nole, and fed can play for a very very long time. especially fed since he plays the game so easily and he is a master of managing his health and his fitness.