If I said to you the following: "I have been reading all the books in the fiction section of the main library in my city, trying to make sense of them as one book. I find it all very frustrating..." You would think I was insane for trying to read all the fiction books in my city's library as one work, wouldn't you?
The books in the library are written by different authors, over a period of many different years and eras, and though they are all fiction, there is a plethora of different genres in fiction.
So is it the fault of the books I am reading that I can't make sense of them, or do I need to see a shrink because of what I am demanding from the books (and for my blaming them and their authors as I do since they are not fulfilling my insane expectations)?
As a Jew, nothing frustrates me more when people speak about our Scriptures as a single "book." It bothers us to no end when people think it is a book that is supposed to be the basis of religion, a compendium of doctrine in theology, an authority on what someone is supposed to believe and how they are supposed to act. Jews don't view their Scriptures this way at all.
First of all, our religion is not based on the Scriptures we wrote. We had a religion to begin with, and over time we wrote things down to teach moral lessons based on religious concepts. In other words, the Scriptures are based on our religion. Religion first, Bible after. If we didn't have a religion, we wouldn't have written religious stories. So don't use the Bible as a basis for religion. It's a reflection of a religion, and a static reflection at that.
Next, don't read one part of the BIble as if it has to make sense with another section. That is total lunacy. Why Gentiles insist on doing that, I can't imagine, but it is the same as in my opening illustration: this is a library of books, written by various authors, over a period of generations, employing various types of genre and literary narrative. Just because you read in Ecclesiastes and the Psalms about something that sound the same doesn't mean that there are agreeing.
On top of it all, the writers of the Hebrew Bible did not expect that our Scriptures would ever be read independently of our religion. Did the authors of the Quran write texts to be read independently of Islam? Are the prayers and religious lessons of Tibetan Buddhism meant to be read by ignoring the intentions of the same Tibetan Buddhists that wrote them? Of course not. So don't try to read the Bible without asking the community that gave birth to it what it is talking about.
That being said, let's look at the texts you are mentioning.
Ecclesiastes is from the Ketuvim of the Hebrew Scriptures, or the "Writings" section of this library. Containing less authority than prophecy, the Ketuvim preserve ancient instruction from the past. Ecclesiastes is found in the Five Megillot, a collection of short books of Ketuvim lumped up into one (along with the Song of Songs, Ruth, Lamentations, and Esther). Written by an author who identifies himself as "Koheleth," it deals with the frustrations caused by man's limited scope of observation and understanding of the universe.
Ecclesiastes 1:4 reads: "One generation goes, another comes, but the earth remains the same forever."
While some Gentile translations have attempted to render the verse in such a manner that it makes the statement appear as if Koheleth is making a cosmological statement, a simple reading of the first chapter shows that Koheleth is merely speaking poetically of the seemingly futile cycles of life that never seem to change.
Now the Psalms are our prayer book. We composed these as prayers to recite, and we have been reciting them regularly ever since we put them together. We pray them daily on a revolving cycle. Even the Catholic Church does this, known as the Liturgy of the Hours, which they inherited from the Jewish tradition, praying over all 150 psalms on a 4-week cycle. In both Judaism and Catholicism the psalms are chanted on certain days and hours, and sometimes for certain occasions.
As such, the psalms are written in very poetic ways. This means there is often not much that is to be taken at face value from a first blush or surface reading. Psalm 105:5 (which is actually Psalm 104:5 in the Hebrew Bible) reads:
"God established the earth on its foundations,/so that is shall never totter."
Again some Gentile renderings try to render the text to lean towards a view that the psalmist had a cosmological science lesson about the earth to pass on in the form of a prayer, but that is not the case. While some of these non-Jewish translations read that the "earth remains forever," the text actually means that it will "remain" in place, as something established does like a building.
Note that the text says that the earth stands "on foundations." The view of the ancients was that the "earth" was not a planet but a flat surface, sitting on pillars. The cosmos was believed to be composed of water, not a vacuum of space. If it were not for a dome acting as a dam over the earth, the waters from the universe would flood the planet and wash it away.
This cosmological model was not one created by the Jews. It was the "science" of the day in Mesopotamian culture. Thus whenever the Hebrew writers mentioned the cosmological features, they spoke of it in ancient terms. We do the same when we talk of "planets." The word "planet" means "wandering star," even though we know these are not stars nor are they wandering. We haven't changed the word we use, even today, but we still speak of Jupiter and Mars and even the earth as a "planet" or "wandering star." It is the same for the language of Jewish Scripture which just used the common expressions of the cosmos when discussing these things.
The verse does not say that the earth is meant to last forever or eternally any more than it is saying that the foundations are literal. It is a prayer. It is using figurative language. It is meant to be sung or chanted. Because of this the official Catholic version of the Psalms in English, the Revised Grail Psalter, is released with accent marks over the words to aid in the chanting process. Like all songs, the lyrics or words are never taken at face value. Why someone would demand that they were literal is odd as people don't demand this of other poems or the lyrics to other songs.
There is nothing in the library of Jewish Scripture that claims to be a composition created by means of the scientific method. As such, no one can rightly read the text as if it were the result of such a methodology. If Christians say "it has to be literal" or else their faith dissolves, then what kind of faith is that? Jews know its not literal and it doesn't stop them from praying or cherishing these words.