Teacher, Preacher, Solomon, Koheleth, whatever you call him, has been a sinner, a smoker AND a midnight toker, exploring pleasure, laughter and wine in the effort to find out what makes people happy in their brief time on earth. Oddly, despite this being years before the invention of LOLcats, he still concludes that it's all meaningless.
Then he gives us a list of all his material possessions: a big house with a wine cellar, gardens, swimming pool, slaves, concubines, gold, silver, a personal orchestra, the guy was more extravagant than an African dictator. And talk about your wealth gaps: he was richer than all of the rest of Jerusalem put together.
And then one day he looked around and realised it was all futile and he decided to start thinking about wisdom and folly, although whichever you choose to be, the ending is the same and no one remembers you anyway.
Then he decided he hated life, because the fruits of his hard work would just go to someone else, and he doesn't know whether that guy will be wise or a fool. Well, if he's been reading his Proverbs, he'll know it all depends on the thickness of the rod.
So he works himself into despair, thinking about this imaginary heir who won't have done any work for his inheritance, and how he won't have anything but vanity and vexation.
Then he concludes that the best things in life are food, drink and work. And since he has more of those than anyone, he must be pretty awesome, especially since he can tax poor people into giving him even more wealth. Though he concludes by saying it's still futile.