Eusebio Di Francesco was sacked after the team's elimination in the Champions League last-16 last week with Ranieri returning to the club he coached for 18 months until February 2011.
The 67-year-old former Roma player was welcomed back to the Stadio Olimpico with a banner reading "Good luck Mister Ranieri".
"I have to congratulate the team, it was not easy under these conditions," said Ranieri.
"A big thank you to the fans who have been close to us in a difficult moment."
It was nervy debut for the former Leicester and Chelsea boss against a side who are just one point above the relegation zone.
El Shaarawy turned in off a corner after nine minutes for his ninth league goal this season only for Empoli to level when Roma defender Juan Jesus headed into his own net.
The Romans nearly conceded another when Giovanni Di Lorenzo sent just wide before Schick put the hosts back on front after 33 minutes, jumping highest to nod in his third league goal this season.
Midfielder Nicolo Zaniolo hobbled off with a calf injury with Schick also coming off injured while Alessandro Florenzi was sent off for a second yellow card with ten minutes to go.
Empoli looked to have scored a late equaliser when Rade Krunic fired into the goal on 89 minutes but a VAR review disallowed it for a Dmitri Oberlin handball in the build-up.
Ranieri's side held on in a nervy six minutes of injury time to get back to winning ways after their 3-0 defeat to Lazio last time out.
Roma remain fifth, three points behind Inter Milan who occupy the final Champions League berth, and four adrift of third-placed AC Milan, with the city rivals going head-to-head on Sunday.
Roma will be without Florenzi when they play SPAL next weekend.