The book of Ecclesiastes is one of my favorite books. There are two basic points that the book seeks to make.
First, the teacher argues that the logical outcome of life from the point of death is meaninglessness. If death is the great leveler of everything, then everything is meaningless. This is why one of the refrains of the book is:
"Meaningless! Meaningless!" says the Teacher. "Utterly meaningless! Everything is meaningless."
The teacher reasons that work, rest, success, failure, righteousness, and everything in between means nothing if death has final sway.
What does anyone gain from all their labors at which they toil under the sun?
Again he writes:
I have seen all the things that are done under the sun; all of them are meaningless, a chasing after the wind.
From this perspective, eat and be merry might be the advice and main theme of the book, but surprisingly it is not. The reason for this is there is another voice in the book. This is where the teacher's true voice enters. According to the teacher, yes there is death, but not all things are meaningless, because there is a God. So, even though death exists, God does as well. This changes everything. He concludes:
Now all has been heard; here is the conclusion of the matter: Fear God and keep his commandments, for this is the duty of every human being.