v1: Solomon the preacher, see v12. The Hebrew title of the book was Koheleth, the preacher.
v2: The preacher's 'text' and summary, the subject of the whole book. Today we may speak of nihilism and anarchy. Similar phrases occur around 40 times in the book.
v3-11: The cycle of life without God; life only has meaning because God exists. Unless God is present, life truly is "meaningless" or 'vanity of vanities'. While life is only that which is "under the sun," it must remain meaningless. This phrase, or similar, occurs more than 30 times.
Creation itself continues in cycles, the sun, wind, water, and human life follows a similar pattern. Material gain is worthless if a man loses his soul (Mark 8.32; 1 Tim 6.7).
The lessons of the past are not learned, and we therefore inevitably repeat the mistakes of the past.
v12-18: Solomon set his heart to know wisdom, and even to understand madness and folly, but such knowledge for its own sake brings only grief and sorrow; contrast Prov 1.5; 9.9.
Whilst Proverbs insists on a real personal commitment to God, Ecclesiastes is the sad experience of the backslider, the one who departs from God.
Solomon had attained and gained and understood, yet the result was a grasping for the wind, with grief and sorrow; it is often the open hand, rather than the grasped fist, which holds more.