The offer came in a letter delivered by French Foreign Minister Laurent Fabius, visiting Tehran on a short trip that has attracted a mixture of optimism and criticism in the capital.
Fabius said the July 14 nuclear accord between Iran and six world powers including France offered the chance for rapprochement after years of strain.
But some Iranian media have since attacked the diplomat's hawkish stance in the nuclear talks.
He has also been criticised over his role in a tainted blood scandal that killed hundreds of Iranians in the 1980s.
More From This Section
"We are two great, independent countries. It is true that in recent years, for reasons that everyone knows, the ties have cooled but now thanks to the nuclear deal, things will be able to change," he said.
Around the time Fabius landed in Tehran a small but vehement group of protesters gathered at Mehrabad Airport to oppose the visit, citing the blood deaths that occurred when he was France's prime minister.
"King of Aids, you are not welcomed," one billboard read, while another stated: "We will neither forgive nor forget."
Fabius was acquitted in 1999 by French courts over the affair, in which people in France also died.
Iran's Tasnim news agency said some protesters who were asked to end their demonstration had been briefly detained.
But Fabius held a short press conference with his Iranian counterpart Mohammad Javad Zarif, where the invitation to Rouhani from French President Francois Hollande was announced.
If taken up, the trip would be the first to France by an Iranian president since 1999.
Rouhani was elected in 2013 after pledging to push for a diplomatic end to a then decade-long crisis over the Islamic republic's disputed nuclear activities.