Someone commented to me that there is an ancient text talking about how everything has been said before. There are of course more recents thoughts along this line, but to me it was very impressive to think that this was said thousands of years ago, so I would be very thankful if someone knew about old quotes like that
After some searching, I cannot find an older succinct expression of the concept than that in the book Ecclesiastes from the Hebrew Tanakh, which has become the Old Testament of the Christian Bible. Ecclesiastes (Koheleth in Hebrew) is a piece of wisdom literature on the topic of futility, which dates to somewhere between 450-180 BCE. In Ecclesiastes 1:9 it is expressed:
What has been will be again, what has been done will be done again; there is nothing new under the sun.
This concept is repeated throughout the book to reinforce the theme of the futility of human effort. The philosophy is not original. As has been pointed out in the comments, it bears resemblance to the notion of eternal return: the idea that in an infinite universe there must be a cycle of time in which the same events repeat over and over. This idea has been discussed in ancient cultures around the world.
The book of Ecclesiastes does not go as far as declaring a concept of eternal return, which would have gone directly against the traditional Jewish belief in a linear timeline with a defined beginning and end. Perhaps the idea is expressed so succinctly because it was a somewhat novel idea in Jewish culture.
There is, however, an iteration of this idea that more closely matches the wording of the question, from about the same depth of time. The Roman playwright Terence, in his 2nd century BC comedy Eunuchus, wrote:
[The author]...doesn't deny that in his Eunuch he has transported characters out of the Greek: but ... if the same characters will not be permitted, how is it more permissible to depict a servant on the run, or to make use of good old women, evil courtesans, a gluttonous parasite, a braggart soldier, a changeling, an old man duped by a servant, or even love, hate, and suspicion? In short, nothing is said that has not been said before.