Ecclesiastes thinks that, as the narrator says at the beginning of Disney's version of Peter Pan, "This has all happened before, and it will all happen again". Everything that has once occurred will come to pass again, and everything that will happen has already happened before:
What has been is what will be, and what has been done is what will be done; there is nothing new under the sun. Is there a thing of which it is said, 'See, this is new'? It has already been, in the ages before us. (1:9-10)
But the Bible, if you look at it as a whole, isn't a book of aimless repetitions—it has an overarching story that, if you read the Jewish Bible, ends with the Persian Emperor asking the Israelites to rebuild God's Temple in Jerusalem. If you read the Christian Bible, it ends with the future destruction of the world and the restoration of the Kingdom of God. (Although, that actually is a circle—you end up where you were at the beginning in Genesis, with Eden and the Tree of Life.)
But Ecclesiastes doesn't think history has a point—it's not leading up to some big climax, like the arrival of the Messiah. It's something you need to endure, not something that you can "win" or triumph over. God has set you down at a point in the circle of time, which keeps running around and around, endlessly—your duty is to fear him, and to determine what point of time you're in. Ecclesiastes makes it clear that there's a time for everything. In what might be the book's most famous passage, he says that there's "a time to be born, and a time to die; a time to plant and a time to pluck up what is planted," etc. (3:2-9).
So, even though everything is "full of weariness" and is totally repetitive, by identifying the proper moment in time that you happen to be stationed at, you can still live life with gusto. The Canadian Sage, Northrop Frye, commented on this part of Ecclesiastes, writing, "Only when we realize that nothing is new can we live with an intensity in which everything becomes new."