At Gibeon the LORD appeared to Solomon during the night in a dream, and God said, "Ask for whatever you want me to give you." (1 kings 3:5)
Give me an understanding heart so that I can govern your people well and know the difference between right and wrong. For who by himself is able to govern this great people of yours?" (1 kings 3:9)
I will do what you have asked. I will give you a wise and discerning heart, so that there will never have been anyone like you, nor will there ever be. (1 king 3 :12)
And God gave Solomon wisdom and understanding exceeding much, and largeness of heart, even as the sand that is on the sea shore. (1 kings 4:29)
King Solomon was greater in riches and wisdom than all the other kings of the earth. (1 Kings 10:23)
From the Above verses it seems like solomon is a great king and yahweh has blessed him with all Wisdom, riches, discerning Heart, one who knows RIGHT FROM WRONG!!.. The Prefect man as the King on earth, imagine people of the world came to get his wisdom?. Surely if YAHWEH has blessed him from himself then this blessing will always remain in him. After all Yahweh came to his dreams and asked him what he wants, It's not often yahweh comes in dreams.?
However Yahweh didn't even know what was coming to him. It's seems like ya he got tricked by the wives of solomon!. They say the older you get the wiser you become, not in this case solomon was supposed to have been given wisdom at a very young age.
As Solomon grew old, his wives turned his heart after other gods, and his heart was not fully devoted to the LORD his God, as the heart of David his father had been.
(1 kings 11:4)
So solomon became a pagan? His wives turned his HEART AWAY FROM GOD?.. How is that even possible when Yahweh himself granted solomon with such qualities of wisdom? A man who was blessed by God went against it? Can you imagine a Prophet of God became a pagan How could this be? Which begs the question why jews and Christians will have books written by a pagan I.e songs of Solomon and proverbs?