ONCE he had been swallowed by a fish, ol’ Jonah demonstrated an amazing amount of humility & eloquence. In desperation (and in faith), he actually prayed to God for mercy – AFTER he was as good as dead. Who would have imagined that there could have been any hope for Jonah? But, one thing can be said for sure about that prophet: he didn't doubt God's power. He didn't always care too much for God's priorities & methods, but he did believe in His mercy & power.
Presumably it was only after all of the events of the book of Jonah were concluded that Jonah sat down & recorded his story. Perhaps that means that he did eventually come around to God's perspective on things. It is interesting that in Jonah 2:2 we read that Jonah says that he cried "out of the belly of hell" instead of "out of the fish's belly" (vs. 1). Some think this statement and the phraseology of Jonah 2:6-7 may indicate that Jonah literally died & was resurrected. That could be, but it isn’t necessary, nor does it really matter. It would make the comparison with the resurrection of Christ particularly strong in Matthew 12:39 & 43. But, the most significant thing is simply that Jonah prayed & God heard. Jonah prayed & thereby survived. And, by the way, Jesus also prayed & thereby was resurrected. Once more, the same can be true for everyone else too. Romans 10:13 says as much: "Whosoever shall call upon the name of the Lord shall be saved," not just from physical death, but from spiritual & eternal death too.