Eratosthenes was born in North Africa the town of Cyrene. He studied under a number of influential Greek scholars, and through those connections he ended up moving to Alexandria to be the tutor for a future king of Egypt (Ptolemy IV.) After the death of the head librarian, Eratosthenes got the job, and was in charge of the greatest library of antiquity.
Eratosthenes made the first accurate measurement of the size of the earth. He does this with a little bit of geometry, and the knowledge that, due to the curvature of the earth, if the sun is seen as directly overhead at one place at a particular time, the sun could not be directly overhead at a different place at the same time, as follows.
Eratosthenes had heard that on the summer solstice, at exactly noon in the town of Syene, a stick cast no shadow, and one could see the reflection of the sun in the bottom of a well. This meant that the sun was directly overhead at this time. Eratosthenes knew that the sun was never directly overhead where he lived in Alexandria. He also knew that Syene was due south of Alexandria. He realized that if he knew the distance between the cities and the anglular distance between overhead and the sun in Alexandria on the summer solstice, he could easily find the size of the earth.
At the summer solstice, Eratosthenes measured the angle between straight overhead and the sun in Alexandria. He found that angle to be 7.2 He also hired someone to measure the distance between Syene and Alexandria, which was found to be 5000 stadia. The only assumption he makes is that the rays of light from the sun hitting the earth are essentially parallel. Calculating the size of the earth is then just some simple geometry. In the diagram above, Syene and Alexandria are on the circumference of the earth. The 7.2 is also the angular separation between the cities, and the arclength between them is 5000 stadia. Therefore we can say:
Solving for the circumference c, we get 250,000 stadia for the circumference of the earth. His accuracy depends on what was really meant by a "stadia," as there is considerable debate as to how long this really was. A stadia was the length of a Greek Stadium. Unfortunately, there was no single standard size. Historians put a range of 157.2 to 166.7 meters for the length of a stadia, giving a range of 39,300 km to 41,680 km for the circumference of the earth. (The accepted value today is about 40,000 km, through the poles.)
On a side note, Eratosthenes also invented a procedure to find prime numbers that is still called the "Sieve of Eratosthenes."