Ecclesiastes is a Wisdom Literature book, which is written in a poetic style. The person who is suspected to have wrote it is Solomon, and it is someone who has information, wisdom and something valuable to share.
The author of Ecclesiastes is a hotly debated subject and has been for some time, specifically the last 3 to 4 centuries. (18th/19th)
It was written for us, so that we may see what really is of worth, which is God and our relationship with him. It is meant for us to go in the direction towards Christ rather than just our desires outside of Christ, which are meaningless.
The main theme of Ecclesiastes is humanity's fruitless search for contentment. Solomon's sub-themes are that contentment cannot be found in human endeavors or material things, while wisdom and knowledge leave too many unanswered questions. This leads to a sense of hollowness. Meaning in life can be found only in a right relationship with God.