Federer came through 2-6, 6-4, 7-6 (9/7) against 13th seed Coric after earlier beating Portugal's Joao Sousa 6-4, 6-3 in the second round as players doubled up after rain wiped out play on Wednesday.
It is that match against Coric that is believed to have caused Federer's injury, with him revealing after the 3-hour, 51-minute contest that he tweaked his leg after slipping on the wet baseline.
Osaka couldn't immediately say how serious the injury was, or if it will affect her status for Roland Garros.
"Right now I'm.in between sad and disappointed because I really wanted to play my match today. I am not 100% physically and after consultation with my team, it was determined that I not play", said 20-time Grand Slam champion Federer. Rome has always been one of my favourite cities to visit, and I hope to be back next year.
Federer was not originally planning to play in Rome but he changed his schedule last week, saying he would rather play matches than practice ahead of the French Open, which starts in nine days.
This time a year ago, Naomi Osaka had never won a grand slam, was ranked outside the top-20 and could only win one game in an Italian Open second-round match against Simona Halep that lasted 59 minutes.
Osaka, who broke through by winning the US Open last year and Australian Open this year, did not survive the second round in her two previous appearances in Rome.
Bertens, who won the Madrid Open last week, will face Marketa Vondrousova or Johanna Konta for a spot in the final.
Osaka also withdrew before a semifinal in Stuttgart, Germany, last month due to an abdominal injury. I feel like there's a big difference between saying No. 1 in the world versus No. 2.
"At the same time, everyone knows this about me: the Grand Slams are the things that I care about the most".
In the women's event, Japan's Naomi Osaka, the top seed, also won twice to retain the world number one ranking ahead of the start of the French Open.
On court, Argentina's Diego Schwartzman dispatched Japanese sixth seed Kei Nishikori to reach the semi-finals.
The world number 24, a French Open quarter-finalist a year ago, has not dropped a set so far on the red clay of the Foro Italico and next faces either the top-ranked Djokovic or compatriot Juan Martin del Potro.
John Wick strategy game launches May 17th on PC
John Wick Hex highlights your graphics style and the different strategies you can use in the heat of action. Below you can check out the first official trailer for John Wick Hex in addition to some screenshots.