The book of Ecclesiastes is a key to a more inward-directed Judaism, posing as it does the great questions:
What is life?
What is it all for?
These are the basic questions of every thinking person.
And in the course of the book, all the substantial, rational, and usual solutions to this question are demolished, again and again.
What is the purpose of life? Certainly not any one of the possibilities that Ecclesiastes raises, telling us of his own experience and eventual despair.
The essential conclusion of the book, in terms of the answer to the fundamental question, is that there is no way of finding the purpose of life within the framework of physical life itself.
And if we pursue this line of thought, we reach a conclusion that if there is a purpose to life, it has to be beyond life.
–Rabbi Adin Steinsaltz