Often you will hear climate change deniers or other anti-science buffoons saying, as if it was a valid argument, that scientists thought the earth was flat for hundreds of years. On of these was the hilariously very temporary Whitehouse Communications Director, Anthony Scaramucci1. The statement that scientists used to believe the earth was flat is a lie.
According to some, Pythagoras was the first Greek who referred to the earth as spherical and that was in the 6th Century BC2. The sphericity of the Earth was also known to Parmenides and Empedocles in the 5th Century BC. After that time, no Greek writer of repute thought the world was anything but spherical2. However, there was no written justification for this assertion.
It was Aristotle (384-322 BC) who apparently first provided observations supporting the sphericity hypothesis. These included: That travellers going south see southern constellations rise higher above the horizon as they progress; that the shadow of the Earth on the moon during a lunar eclipse is round2.
It was Eratosthenes (276-194 BC) who estimated the Earth’s circumference, probably about 240 BC. He based his calculations on the fact that at the summer solstice (in the northern hemisphere when it reaches its most northerly point relative to the celestial equator) the sun was directly overhead in Syene (modern Aswan in southern Egypt), whereas in Alexandria (northern Egypt) it was at an angle. Based on the assumption that the Sun is so far away that its rays are essentially parallel, he calculated the diameter only a few percent different to the actual circumference of 40,008 km2,3.
If you assume that the foundations for the scientific method were laid down by Ibn al-Haytham (~965-1040 CE) in the Islamic Golden Age4, as is often acknowledged, then you can be certain that scientists have never thought the Earth was flat. Anybody who tells you otherwise is either a liar or just plain thick.