The closing words of Ecclesiastes read:
13 The end of the matter; all has been heard. Fear God and keep his commandments, for this is the whole duty of man. 14 For God will bring every deed into judgment, with every secret thing, whether good or evil.
After every word of wisdom, every piece of advice, Solomon concludes with this simple statement. The end of the matter, the point of the whole thing is to follow after the Lord. Having riches and earthly enjoyment will fade, and being poor will not last forever. Those who do good deeds and those who do evil will both die, as will the wise and the foolish. If none of them seek the Lord, their lives are meaningless.
We would do well to remember this. Without the strength of the Lord, nothing we do is eternally worthwhile. We must seek Him out, for any real treasure, any real joy, any true life is found only in Him. That is the end of the matter.