This sermon by Solomon is ‘an inspired confession of failure.’  He speaks with regret about the futility of happiness of life apart from God… or, as he says it: “all is vanity and vexation of spirit … under the sun.”
*Note to the reader: This book is a divinely-inspired editorial of life.  It is very cynical and must be taken in the context that these thoughts are not God’s intents on what life should be like!