One of Jonah's most amusing moments is his confession of faith, offered to pagan sailors during a storm from the LORD that threatens to capsize their ship and drown them all: "I am a Hebrew. . . I worship the LORD, the God of heaven, who made the sea and the dry land" (1.9).
It's amusing that Jonah should speak thus because the storm was the LORD's doing: Jonah had received a call to go preach to the city of Nineveh, but Jonah instead decided to flee in the opposite direction to escape Yhwh's call (vv. 2-3). What kind of worship of God is that, when you flee from his call and refuse obedience?
Oftentimes in life our experience is exactly the same: we identify with God, we claim to worship him, but we make claims such as these in moments or in times when our behavior might suggest otherwise. If we are lucky we become aware of the hypocrisy at the moment, and through some kind of guilt or shame are motivated to change ourselves, to begin to live differently.
What Jonah does after is this: he offers to be thrown off the ship, so that calamity may not befall the other sailors (v. 12). It is not exactly clear what motivates him here, either: does he wish to die, so as to escape God's call in a sort of permanent way? Or is this an act of self-surrender to Yhwh, to accept whatever fate may come, motivated by pangs of conscience in the face of Jonah's own hypocritical witness to the LORD?
Jonah's prayer of thanksgiving for God's deliverance (2.2-9) comes before the fish spits him up on the land (v. 10) but after he fell into the sea (1.15-7), which inclines me to think the latter interpretation is better: Jonah gives himself over to Yhwh, ready to receive what the LORD will give him, expecting perhaps death and a watery grave, but receiving instead salvation.