Ecclesiastes means 'one who convenes an assembly' and it is sometimes translated 'preacher'. The book of Ecclesiastes in the Old Testament, along with Job and Proverbs, is sometimes referred to as the wisdom literature, including teachings that show the advantage of wisdom over foolishness.
As one reads Ecclesiastes, it must be understood that the author believes this life is all there is. It is not until the last chapter that he admits he really does believe that life continues after death, and that because life goes on forever, life has no lasting meaning or happiness unless we serve God and prepare for the Judgment, where all that was temporary will be seen for what it really is. (The author uses the word 'vanity' which is interpreted as 'temporary and not satisfying). He records in Ecclesiastes 12:13, "Let us hear the conclusion of the whole matter: Fear God, and keep his commandments: for this is the whole duty of man."