The shape of the land of Middle Earth had changed a few times due to battles with Melkor (when the lamps melted and fell, when they imprisoned Melkor for three ages, and when Melkor was cast into the Outer Void). But it was not done on purpose.
But up until the Fall of Númenor, the world was flat. The two bodies of water that were on either side of Middle Earth just poured off their north and south sides. On the other side of the bodies of water (the inner seas) were Valinor in the west, and in the east: The Lands of the Sun.
At the beginning of the First Age when the Noldor left Aman, the Valar raised up mountains shielding Valinor and The Lands of the Sun, so that no one would disturb the rising and falling of the sun and the moon.
When the Valar cast the island of Numenor into the sea they utterly changed the shape of the earth. They made the area from the western sea all the way to the eastern sea (not including Valinor and The Lands of the Sun) into a globe, so that sailing west ended up landing on the eastern shores again. Although there was a still a path for those Eldar who wished to retire to the West.