The top seed, who has yet to drop a set in the tournament, beat Mayer 6-3 6-4 with his ninth Wimbledon title firmly in his sights.
Federer broke Mayer quickly to win the first set, with the German squandering two break points at 1-0 in the second set and failing to recover after Federer broke again, to finish up in just over an hour.
After wins at the Australian Open as well as Indian Wells and the Miami Open earlier this year, Federer decided to miss out the clay-court season - seen as a move to enhance his prospects at WImbledon, on his favoured grass surface.
'You don't have to fool yourself' - Nadal accepts Djokovic will win most Grand Slams
However, doubt was cast on his comeback last week as he lost his first competitive grass court match of the season, to 39-year-old Tommy Haas.
He will now face rising talent Karen Khachanov in the semi-finals.
Frenchman Richard Gasquet also reached the last four, after beating Dutchman Robin Haase.
Gasquet will now play the winner of the last quarter-final between local favourite fourth seed Alexander Zverev and Spaniard Roberto Bautista-Agut later on Friday.
Halle Open quarter final results
Roger Federer (SUI)  beat Florian Mayer 6-3 6-4
Richard Gasquet (FRA) beat Robin Haase (NED) 6-1 3-6 6-1
Karen Khachanov (RUS) beat Andrey Rublev (RUS) 7-6(8) 4-6 6-3
Additional reporting by Reuters.
'Federer faces reality check' - Wilander
'It's not going to be shameful' - Medvedev doesn't want pressure of matching Big Three