"Vanity of vanities," says the Preacher, 'vanity of vanities, all is vanity'" (NKJV). Ecclesiastes is a book of perspective. The narrative of "the Preacher" (KJV), or "the Teacher" (NIV) reveals the depression that inevitably results from seeking happiness in worldly things. This book gives Christians a chance to see the world through the eyes of a person who, though very wise, is trying to find meaning in temporary, human things. Most every form of worldly pleasure is explored by the Preacher, and none of it gives him a sense of meaning.In the end, the Preacher comes to accept that faith in God is the only way to find personal meaning. He decides to accept the fact that life is brief and ultimately worthless without God. The Preacher advises the reader to focus on an eternal God instead of temporary pleasure.http://www.gotquestions.org/Book-of-Ecclesiastes.html
The purpose and design of Ecclesiastes is warns us that the happy and also prosperous lives shall end in disaster if centered on the earthly things. Another one is that it calls people back to a sensible and even good life with God.