Some argue that Solomon could not be the author of Ecclesiastes since Qoheleth (the named author of Ecclesiastes) complains of corruption of government officials:
If you see in a province the oppression of the poor and the violation of justice and righteousness, do not be amazed at the matter, for the high official is watched by a higher, and there are yet higher ones over them.
5 There is an evil that I have seen under the sun, as it were an error proceeding from the ruler:
6 folly is set in many high places, and the rich sit in a low place.
Yet even during lifetime of Samuel – a more godly man than Solomon – the primary judges (Samuel’s own sons!) were corrupt:
1 When Samuel became old, he made his sons judges over Israel.
2 The name of his firstborn son was Joel, and the name of his second, Abijah; they were judges in Beersheba.
3 Yet his sons did not walk in his ways but turned aside after gain. They took bribes and perverted justice.
1 Sam. 8. And famously, God told Samuel of the coming judgment against Eli’s house due to the corruption of his sons.
While the parallels prove nothing positive about Solomon as the author of Ecclesiastes, they do show that the contention that Solomon could not have tolerated corruption is weak. This does not speak well of Solomon’s character – but the Bible does not speak well of his character either.
A final parallel to the passage about Samuel’s sons (this an illustration of the passage):
Surely oppression drives the wise into madness, and a bribe corrupts the heart.
Psalm 58 raises the same evil
1 Do you indeed decree what is right, you gods? Do you judge the children of man uprightly?
2 No, in your hearts you devise wrongs; your hands deal out violence on earth.