My question about this answer was tangential, but I'm very curious to know where the idea comes from that people believed in a flat Earth. For example, were there Greek philosophers that held this view, and made arguments for it? Or is this an idea that began showing up later, as in, "oh, yeah, people used to believe that"?
Many ancient models of cosmology had a flat earth, but not in the sort of uninformed way that people imagine when they say things like, "Well, they used to think the Earth was flat!" Well, yes and no. From the earliest Greek cosmology that I know of, the shape of the earth was a topic of debate and one that great thinkers understood was an open question. Anaximander famously held a flat earth, but, again, his model was extremely sophisticated and modeled the Earth after a cylinder to accommodate a plethora of other keen observations. His model can also be extended to a spherical earth without significant loss. Even though Anaximander held a flat earth (of a sort), his model was a radical breakthrough for cosmology, since it explained how the Earth could remain steady without needing to rest on anything below it (like a turtle). It's hard to overstate how profound an effect this has on the picture of the universe that we have today, perhaps more significant than a spherical earth. Features such as this would pave the way for overcoming the great limitation of Aristotle's physics, which was that his physical laws were not uniform in all parts of the universe. Moreover, there is evidence that Plato, in the Phaedo, held the earth to be spherical in response to Anaximander's model. In short, ancients did not simply assume the earth was flat because it looked flat, but understood this as an important question that needed to be settled by scientific means. Their thoughts on the topic were informed---as ours are---by the best science of their day.
There is a great deal more to be said, but even from this small and insufficient survey I think you can get a general answer to your question. There's a lot of information out there on the cosmology of pre-Socratic philosophers. These models were being created by thinkers on busy port cities where ideas flowed as freely as material goods, many of whom themselves traveled abroad. In particular they were quite influenced by ideas coming from Egypt (they liked Egyptian ideas as much as their textiles). I'm not sure whether Egyptian cosmologies had a flat earth or not.
The flat earth movement is very recent: it started in the 1840s, around the same time Kierkegaard was writing his Postscript, when an amateur cosmologist named Samuel Rowbotham, writing under the pen name “Parallax,” began self-publishing anguished screeds on the Satanic science of astrology and the evil deception of a globular earth.
From Village Atheists, Village Idiots, by Sam Kriss. Brilliant and insightful essay, well worth your time to read, on the folly of those who so loudly proclaim that the earth is round. As Kierkegaard observed, this is no evidence of sanity.
Soren Kierkegaard, the great enemy of all pedants, offers a story that might shed considerable light. In his Concluding Unscientific Postscript, he describes a psychiatric patient who escapes from the asylum, climbing out a window and running through the gardens to rejoin the world at large. But the madman worries: out in the world, if anyone discovers that he is insane, he will instantly be sent back. So he has to watch what he says, and make sure none of it betrays his inner imbalance—in short, as the not-altogether unmad Danish genius put it, to “convince everyone by the objective truth of what he says that all is in order as far as his sanity is concerned.” Finding a skittle-bowl on the ground and popping it in his pocket, he has an ingenious idea: who could possibly deny that the world is round? So he goes into town and starts endlessly repeating that fact, proffering it over and over again as he wanders about with his small furious paces, the skittle-bowl in his coat clanking, in strict conformity with Newton’s laws, against what Kierkegaard euphemistically refers to as his “a–.” Of course, the poor insistent soul is then sent right back to the asylum.
Samuel Birley Rowbotham (/ˈroʊbɒtəm/; 1816 – 23 December 1884, in London) was an English inventor and writer who wrote Zetetic Astronomy: Earth Not a Globe under the pseudonym Parallax. His work was originally published as a 16-page pamphlet (1849), and later expanded into a book (1865). He dropped out of school at the age of 9.
Rowbotham's method, which he called zetetic astronomy, models the Earth as an enclosed plane centered at the North Pole and bounded along its perimeter by a wall of ice, with the Sun, Moon, planets, and stars moving only several hundred miles above the surface of Earth.
All documents are technically historical documents, and people still believe the Earth is flat, based on documents that exist today. There's even a whole wiki: https://wiki.tfes.org/Flat_Earth_-_Frequently_Asked_Questions
As for the origin of Flat Earth Theory, no one can truly know, and it in fact may have sprouted from multiple different locations. It makes sense empirically. You see a flat stretch of land, you think the land is flat until you have better evidence that it isn't.