We have come to regard golf as a game for the wealthy and privileged. One imagines an aging businessman making (sometimes unethical) business deals while enjoying a game that is more akin to taking a walk in a weirdly shaped, flat park with the occasional hole in the ground. Perhaps the reason of regarding the game as a bit snobbish are the presumed costs of playing: the clubs, the membership, the transport, the white clothes (their laundry bill) it is a bit too much for your average bloke.
Around the world
Now in all honesty golf is not overly popular in non-English speaking countries and is way more often practiced in the places the world that were part of the Empire (the civilized ones at least). The only people who play it outside of those locations are probably doing it to suck up to businessmen from there (or to someone mimicking them).
One would imagine that this was a game for the nobility of the past but that is quite far away from the truth. In reality it was an everyman sport, since you need as little as a stick and a pebble to play it.
The origins
This is a still-disputed topic, but the common consensus is that golf hails from 15th century Scotland, more precisely the Kingdom of Fife. Similar games have existed in Belgium and Holland at even earlier time periods, but the closest thing to the modern version of the game was played in Great Britain, however there are undoubtedly other foreign influences.
Game for the masses
It was introduced in England by King Charles I, the courtiers that enjoyed the game moved to Blackheath (which today is part of London), where they found plenty of open fields, suitable for playing golf. From that point onwards historically golf spread to all of the territories belonging to the crown.
Becoming a sport
As more and more people started paying the game golfing clubs began to appear. In the 18th century The Gentlemen Golfers of Leith club conceived the first ever tournament with its own set of rules and prizes. Other golfing communities soon followed the example and not after long golf was recognized as a legitimate sport.
Popularity Boom and contemporary golf
At the height of the British Empire in the 19th century golf also saw the peak of its popularity. Passionate about golfing Englishmen spread the game to all the corner of the Empire on which the sun never sets, introducing (to various degrees of success) the sport to the natives. This was also a time of many innovations. By that point it had become a game for the truly wealthy, even more so than today. The leather balls used to play the game were way too hard to produce and therefore acquire, so the need of a new ball shaped object manifested itself. This led to the introduction of the Gutty – the contemporary white golf ball with an uneven surface. Golf became an Olympic sport in 1900.