Solomon
Ecclesiastes 1:3ESV·traditional attribution

What does man gain by all the toil at which he toils under the sun?

Matthew Henry Presbyterian @wholebiblehenry

Here is, I. An account of the penman of this book; it was Solomon, for no other son of David was king of Jerusalem; but he conceals his name Solomon, peaceable, because by his sin he had brought trouble upon himself and his kingdom, had broken his peace with God and lost the peace of his conscience, and therefore was no more worthy of that name.

Commenting on Ecclesiastes 1:1-3

John Gill Reformed Baptist @doctorgill

What profit hath a man of all his labour which he taketh under the sun? This is a general proof of the vanity of all things, since there is no profit arises to a man of all his labour; for, though it is put by way of question, it carries in it a strong negative.

Jamieson-Fausset-Brown Reformed @jfbcommentary

What profit . . . labour--that is, "What profit" as to the chief good (Mat 16:26). Labor is profitable in its proper place (Gen 2:15; Gen 3:19; Pro 14:23). under the sun--that is, in this life, as opposed to the future world. The phrase often recurs, but only in Ecclesiastes.