"The roadblocks may prove to be too great, but I firmly believe the diplomatic path must be tested," Mr Obama said.
But he added that while he was "encouraged" by Mr Rouhani's election, the new president's "conciliatory words will have to be matched by actions that are transparent and verifiable".
In a speech to the UN, Mr Rouhani strongly criticised economic sanctions imposed on Iran as part of the effort to persuade its leaders to open its nuclear programmes up to international inspection.
Even without a meeting between Mr Obama and Mr Rouhani, it is clear the US and Iran are edging close to direct talks.
But Israel, which has long sought tough punishments against Tehran in retaliation for its nuclear programme, was less charitable. Following Mr Rouhani's speech, prime minister Benjamin Netanyahu accused him of "hypocrisy" and said the new Iranian leader showed no sign of halting his nuclear programme.
Mr Netanyahu said: "This is precisely the Iranian intention, to talk and buy time in order to advance its ability to achieve nuclear weapons."
He also accused Iran of supporting terrorists in "dozens" of countries.