It might be a stretch to call it the "invention" of ice cream, but its history goes as far back as 200 BC China. It's believed that, during that time, a mixture of rice and milk was frozen in snow and eaten as a treat. Modern ice cream as we know it, however, wouldn't be around until much later.
The Chinese "ice cream" tradition continued through the Tang Dynasty (618-907 AD), where milk of various animals (usually cows or buffalo) was heated with flour and combined with an extract called camphor, which came from evergreen trees. This mixture was then put into tubes and frozen in a pool of ice.
In the west, Roman emperors were obsessed with ice cream. Emperor Nero was said to have sent slaves hiking into the mountains to collect snow and ice, which would be topped with fruit to create a sweet delicacy.
Modern ice cream began, perhaps, in the 17th century. Antonio Latini, a chef working in Naples, wrote down a recipe for sorbetto (sorbet) that included milk. But by then, gelato was being introduced in Italy, and French chefs were experimenting with an ice dessert they called "fromage" (not to be confused with the same word for cheese).
In the United States, some of the founding fathers had a well-documented sweet tooth: George Washington and Thomas Jefferson each kept ice houses and ice cream pots for whenever their cravings struck. That presidential tradition continued through Abraham Lincoln - Mary Todd held strawberry parties for friends, and they were combined with ice cream.
Today, the world at large delights nightly in what was once a high-class delicacy. Americans eat so much ice cream, in fact, that it uses about 9% of the cow's milk produced each year in the United States.