It is often said that ancient civilizations believed that the earth was flat. But at the same time it is sometime mentioned that Greeks were able to estimate earth's diameter or that Middle age sailors knew that earth was round because of the way ships disappear in the horizon. What is the truth behind "our ancestors beloved earth was flat" ? Who and until when believed that ?
I can't speak to the first question, although I can make a few points about the second and point out that Medieval Authors didn't need to rely on sailors.
The last author to seriously support the notion of a flat earth in the West was Cosmas Indicopleustes in the sixth century. He was the last in a string of Greek Christian authors from the fourth to fifth centuries who opposed the sphericality of the earth as part of a broader anti-pagan polemic.
There was not really a comparable trend in the latin world, where the last author to support this view was Lactantius in the late third to early fourth century (Divine Institutes, 3.24). He opposed it in part of a broader polemic against the possibility of antipodes (people on the other side of the world), although his argument is similar to that of Lucretius, who also ridiculed the notion that there could be people walking around upside-down on the other side of the world (De rerum natura, 1.1052ff.).
There is finally a pseudonymous Cosmographia, supposedly written by a fictive Aethicus Ister, from the eighth century, which is likely a translation of Cosmas.
Also, in the Middle Ages, they didn't need sailors to tell them, as the knowledge of the sphericality of the earth was never lost. Indeed it is straightforwardly affirmed by authors across the middle ages. Perhaps the best early example is that of Bede, who leaves no room for misunderstanding in his description:
That the Earth Is Like a Globe
We say ‘the sphere’ of the earth, not because it has the shape of a perfect sphere, in view of so great a disparity of mountains and plains, but because, if all of its perpendicular lines were enclosed within a circumference, it would make the figure of a perfect sphere. And therefore it happens that the stars of the northern region always appear to us, but never those of the southern region; and in turn these northern stars are not seen by those people, because they are blocked by the globe of the earth. The country of the Troglodytes and neighbouring Egypt do not see the Great and Little Bear, nor does Italy see Canopus. [ … ,] although a part of this same sphere greater by nearly a half from east to west than from south to north is inhabited, since heat prevents access southward and cold northward.
(De natura rerum, 46; trans. Kendall and Wallis, 97-8)
This is essentially drawn from Pliny, Natural History, 2.64.
Similarly, William of Conches (12th C.) offers an interesting argument for the sphericality of the earth, noting that:
If the earth were flat, a city positioned in the east would experience morning and midday at once; from where indeed the sun would appear for them, it would would be above them; in truth a city positioned in the west would have midday and evening at once. And as close as cities are near to the east, so much less time would they have between morning and midday, but more between midday and evening; but as close as cities are near to the west, the contrary. [...]
Since therefore for everyone there is an equal space from morning to midday, [and] from midday to evening, it is clear that the is not flat but round. For which reason in the east, dawn and midday are sooner than in the west.
Si iterum plana esset, civitas in oriente posita mane et meridiem simul haberet; ex quo enim illi sol appareret, super ipsam esset; civitas vero in occidente posita meridiem et vesere [sic ed.] simul haberet. Quantoque essent civitates orienti propinquiores, tanto minus spatii inter mane et meridiem haberent, sed plus inter meridiem et vespere [sic ed.]; sed quanto essent occidenti propinquiores, e contrario. [...]
Cum igitur apud omnes aequale est spatium a mane ad meridiem, a meridie ad occasum, apparet terram non esse planam sed torundam. Vnde apud orientales citius est ortus et meridies quam apud occidentales.
(Dragmaticon philosophiae, 6.2.1-4; as cited in Gautier-Dalché et al., La terre:..., 171-2)
Finally, you can read a translation of the standard thirteenth century textbook on the matter here.