Apple trees grew wild in Central Asia and western China beginning possibly about two to ten million years ago, around the time that the first humans were evolving. Apples are related to roses, berries, peaches, almonds, and many other fruiting plants. Early apples may have been smaller and more sour than modern apples - more like crabapples. Horses, which also lived on the steppes of Central Asia, were eating apples five million years ago.
When modern people arrived in Central Asia about 50,000 BC, they probably began to eat apples right away. By about 6,500 BC, people were carrying apple seeds west to West Asia and east to China, planting apple trees, and eating apples there too. The Bible in English has Adam and Eve eating an apple, but actually in Hebrew it just says that they ate a fruit, and not what kind; the apple comes from a Latin translation (find out why). Still, apples were among the first plants that people planted on purpose. By 2000 BC, people were eating apples in Greece and Italy, and the Romans brought apples to England about 100 AD. People don't grow apples in Africa or India, because it's too close to the equator for apples to grow well.
For ancient and medieval people, the best thing about apples was that they came ripe just as it was getting cold and they would keep all winter, so you could have food even when nothing was growing. People sliced apples and dried them in the sun to make dried apples, and they stored them in underground cold bins just as whole apples, but mostly they pressed the apples with wooden presses to make cider. If you let the apple cider ferment with yeast, it becomes a slightly alcoholic drink, and the alcohol preserves the apple juice all winter. Apple cider was the main alcoholic drink of many people in northern Europe. When Europeans came to North America, they brought apples with them in the 1600s AD, to make apple cider. All along the East Coast, apple cider was again many people's main drink until Prohibition put the cider orchards out of business in the 1920s.
To find out more about apples, check out these books from Amazon or from your library:
Food, by Fiona MacDonald and others (2001). For kids, facts about food from all over the world. A little preachy.
Food in Antiquity: A Survey of the Diet of Early Peoples, by Don and Patricia Brothwell (1998). Pretty specialized, but the book tells you where foods came from, and how they got to other places, and what people ate in antiquity. Not just Europe, either!
Food: A Culinary History from Antiquity to the Present, by Jean Louis Flandrin, Massimo Montanari, Albert Sonnenfeld. (1996). Hard going because it is translated from French, but Flandrin was one of the world's great food historians.