The Swiss star also gave Murray a Tam o' shanter cap to wear before beating the local legend in the charity event.
Federer has urged Andy Murray to concentrate on getting fully fit before considering a return to competitive action.
Former British number one Annabel Croft believes Roger Federer and Rafael Nadal's decisions to take time off in 2016 is now being emulated by other tennis players.
Federer went on to state that once he was done with tennis, he would make time to attend more FC Basel games.
Former American number one James Blake finds it hard to envisage Roger Federer catching Jimmy Conors' record of 109 singles titles.
Federer and Andy Murray played a charity match for the Roger Federer Foundation's Match for Africa 3 earlier this year.
The Swiss revealed that he initially picked up a Wilson racket because of its looks and has persisted with them ever since.
Former British number one Greg Rusedski believes Roger Federer will not have any regrets about skipping the Rolex Paris Masters despite Rafael Nadal's recent withdrawal.
The 16-time Grand Slam winner had to withdraw from the Paris Masters after feeling a recurrence of the injury which put his participation in massive doubt.
Djokovic last featured competitively in his Wimbledon quarter-final clash with Tomas Berdych. The Serbian ace retired midway through the match due to an elbow injury.
Federer and Nadal took their tally to 19 and 16 men's singles Grand Slam titles in 2017 and are expected to add more in 2018.
Nadal has withdrawn from the Paris Masters before his quarter-final match against Filip Krajinovic due to a knee injury.
Roger Federer decided the gap was too big to continue to fight Nadal for the world number one ranking before deciding to skip Paris to focus on the ATP Finals in London.
Rafael Nadal is not ready to take it easy in the final two events of the 2017 season in Paris and London despite securing his place as the year-end number one.
Rafael Nadal has given an update after his knee was bandaged up during his 3-set win over Pablo Cuevas in the Rolex Paris Masters.
Roger Federer has had one his most successful season in a decade having won seven titles thus far in 2017.
Jo-Wilfried Tsonga has opened up on the form shown by evergreen pair Roger Federer and Rafael Nadal.
Former world number one Andy Murray is set to drop out of the top 10 of the ATP tennis rankings for the first time since 2014 due to his absence from the second half of 2017.
Roger Federer pulled out of the Paris Masters to preserve himself for the ATP Finals in London later in November.
Rafael Nadal's victory over Hyeon Chung at the Paris Masters means he will end 2017 as the number one ranked player in men's tennis.
Roger Federer conceded his battle for the world number one ranking with Nadal after withdrawing from the ongoing Paris Masters.
Nadal can become the most successful ATP 1000 Masters Series player if he wins his first title in Paris as he is currently tied with Djokovic at 30 titles.
Roger Federer has reclaimed his spot as the top prize earner in tennis as he overtook Novak Djokovic and closed in on becoming the first player to make $110m in career earnings.
Roger Federer again apologised for skipping the Paris Masters but reiterated that remaining healthy for the remainder of the season and next season is his main priority.
Former world number one Novak Djokovic is looking to change his fortunes in 2018 as he targets more Grand Slam success after a poor injury-ridden 2017.
Rafael Nadal is just a win away from securing the year-end world number one after Roger Federer's withdrawal from the Paris Masters.
Roger Federer confirmed that he will skip the Paris Masters after winning his eighth title in Basel, which will allow Nadal to confirm his year-end No1 status with one more win.
Roger Federer will take on Juan Martin Del Potro in the final of the Basel Open where a win would take him closer to catching current world number one Rafael Nadal in the rankings.
Nadal has confirmed that he will return to action at the Paris Masters after skipping the Swiss Indoors in Basel owing to a knee injury.
Federer has admitted that he could skip the Paris Masters to remain healthy to challenge for the title at the ATP Finals in London.