The evidence for Solomonic authorship of Ecclesiastes is circumstantial (and so weak) and traditional; it is therefore inconclusive but does not exclude that conclusion.
The circumstantial evidence consists of the following:
- The text itself claims to have been written by "the son of David, king in Jerusalem" (Eccl 1:1, 12). However, this could mean any of the Davidic line but does not exclude Solomon
- The style is very similar to Solomon's in his Psalm 72 and Proverbs, allowing for the differences in subject matter and later maturity of style.
- The narcissistic profligacy and repentance plus salutary warnings to others is consistent with Solomon's (meagre) history that we have.
- Since ancient times Ecclesiastes has been attributed to Solomon. The first (to my meagre) knowledge to question this was Martin Luther; and many since.
The question of precise authorship may never be finally settled.