If Jonah ended at chp 3 v. 10 it would be a happy ending. Jonah finally preached, all of Nineveh repented, God relented of his planned destruction, everybody wins. Chapter 4 reveals that Jonah is the only one left not right with God. And that’s the reason it’s in there. Characters with fatal flaws are the ones we can relate to. There are no superheroes in the Bible.