Here are the scriptures in question.
"I, the LORD, have spoken; it is coming and I will act. I will not relent, and I will not pity and I will not be sorry; according to your ways and according to your deeds I will judge you," declares the Lord GOD.'"
When God saw their deeds, that they turned from their wicked way, then God relented concerning the calamity which He had declared He would bring upon them. And He did not do it.
At a cursory reading it might appear as though God says He will never relent, and then He relents. However, each of these two verses need to be kept in their own context.
In Ezekiel, God is declaring that He will not relent of the judgment coming upon Jerusalem through the King of Babylon. God states that He is going to judge Jerusalem, and there is nothing that can be done to change this fact.
In Jonah, however, the author of Jonah is not describing God's relenting of judging Jerusalem, but rather of God's relenting of judging Nineveh.
So we see that since God promises not to relent with respect to Jerusalem, but does relent with respect to Nineveh, there is no contradiction here.
However, this brings up another important issue -- how can a God who knows the end from the beginning (Isaiah 46:10; Revelation 21:6) possibly relent, or be sorry, or change His mind at all? The verse in Jonah is certainly not alone in this sense.
The LORD was sorry that He had made man on the earth, and He was grieved in His heart.
So the LORD changed His mind about the harm which He said He would do to His people.
"Perhaps they will listen and everyone will turn from his evil way, that I may repent of the calamity which I am planning to do to them because of the evil of their deeds."
Some of these types of statements (Jonah 3:10 and Jeremiah 26:3, for example) reflect in human language the unchanging declaration of God that if a man does evil, he will be judged, but if he repents, then God will forgive him and the man will not be judged (Ezekiel 33:12-16).
Other statements along these lines (Genesis 6:6 and Exodus 32:14, for example) are simply anthropomorphisms designed to enable us as human beings to more thoroughly understand God's position on a certain thing and are not intended to be taken in a wooden-literal sense, any moreso than Deuteronomy 32:11 intends to make us believe that God inherently has physical wings just like an Eagle; or Exodus 31:18 intends us to believe that God inherently has physical fingers. The God of the Bible is a spirit (John 4:24), and a spirit does not have flesh and bones (Luke 24:39).
We know that passages like these are anthropomorphisms because, not only do we see clear statements in the rest of the scriptures that God does not genuinely get confused (Numbers 23:19; 2 Timothy 2:13), but also, if they were intended to be taken literally, if the God who created reality were incapable of making up His mind, if He made mistakes, if He didn't know what He was doing, if He were ever inconsistent in the slightest, then we would not be able to trust in anything at all and therefore knowledge itself would be utterly impossible.