Created for spiritual and navigational purposes, the earliest compasses were most likely invented by the Chinese in around 1050 BC. It was made of lodestones, which is a naturally magnetized iron ore.
The invention of the electromagnet in 1825 led to the development of the modern compass.
The invention of the compass certainly helped modern navigation more than our GPS-needing culture could understand.