The Qoheleth started with a "big sigh", "vanity of vanities, says the Preacher, vanity of vanities! All is vanity"(1:2) and this question, "What does man gain by all the toil at which he toils under the sun" (1:3). And at the end of the book, he summarized it with this in 12:13, "Fear God and keep His commandments, for this is the whole duty of man."
I am not quite satisfy with the conclusion that the Qoheleth made at the beginning because I couldn't understand it and accept it because just because everything is under God control, then he made this conclusion.
I've posted the question in FB and I got this answer, "If he dieth, he dieth a little wiser". At first I could not accept this answer because I was questioning that what is the point of being wise if you have died?
Keep on questioning really can help you to find an answer. I got some enlightenment when I questioned about the wise and the fool. I got this answer, "wise people will choose to fear God" even though there are a lot of unfairness in this world. I mean the fool are wise if the choose to fear God. The world define wise as not being stupid, but to be wise in God is to choose to fear him. With this answer I can understand why Qohetleth came to this conclusion even though the rich and the poor, the wise and the fool, the clean and unclean, those who offer sacrifice and those who didn't will come to the same end, DEATH!
After all, life is not really meaningless if we choose to Fear and Keep God's command. Notice, it is our whole duty as a man