This is an interesting question. It's called mixing the tenses. Both are correct.
If you say:
People believed (that) the earth is flat means
In the past, people believed that (as a fact until the moment people believed at that time and they believed that it would be so in the future) that the earth is flat.
People believed (that) the earth was flat (The fact was already obsolete)
means In the past, people believed that (the earth is not flat anymore, it used to be flat, but at the moment of speaking people stopped believing) that the earth was flat.
Reported speech and reported thoughts have their own time.
When you're reporting what someone said or thought, there are two different times to think about:
*the time when the person said it or thought it*
*the time that the person was speaking or thinking about*
The first clause is reflected in words like "_ said" or "_
The second clause and the rest of the sentence are usually the
Both of the verbs of the subject in the main sentences are in past tense, so the sentences carry the past tense.