Briton Murray, bidding for his third Shanghai title, will face Novak Djokovic in a repeat of their memorable U.S. Open final last month after the Serbian beat Tomas Berdych of theCzech Republic 6-3 6-4.
Murray was the dominant player throughout and Federer was merely hanging on for much of the time.
After service breaks were swapped early on, Murray seized control of the opening set in the fifth game when the Swiss served three consecutive double faults.
Murray squandered seven break points at the start of the second set as spots of rain caused a six-minute delay.
Federer was 40-0 up at 2-2 but Murray fired two unstoppable forehands on his way to snatching the game and he never looked back, despite the rain intervention at 5-4.
"It was as tough match, there were a lot of long games in there, and you know won a couple of ones where there were quite a few deuces and I served well throughout the match, especially on my second serve and that helped," said Murray after his win over the man who beat him in this year's Wimbledon final.
Murray will be looking for a third consecutive victory over Djokovic after beating the Serbian world number two in the Olympic semi-final and then in their Flushing Meadows showdown.
"Yeah, I mean this year especially we've had some great matches in Australia and at the U.S. Open, you know a lot of drama in those matches, they've been very, very tight but he's played incredible the last two weeks, I don't think he dropped, he maybe dropped one set in Beijing and he hasn't dropped a set here and he's playing top, top tennis, I saw some of his match today so it's going to be a very tough match," said Murray.
"You'll pay the price you know by having an average game like that against a top guy like Andy so it was a bit up and down, too up and down I guess for my taste to probably beat him tonight," said Federer.
"I played OK at times but overall probably Andy was just the better player and he deserved to win at the end really," Federer added.