Well I have researched three sources for this data, so I hope you don't get lost!
There are two types of compass that I am aware of. A compass can be used for geometry purposes for constructing angles and a compass can be used for direction. I would like to focus my attention on the later type of compass.
1. Wikipedia website
For many years man has used the compass as a navigational instrument for finding directions. Since its inception the compass has been able to make traveling at sea a lot safer and more efficient. Mariner's compass was first invented by the Europeans around 1300.
2. hoover.kiz.al.au website
The history of the compass dates back far before the mariner's compass ever did. Before the time Christ in fact. The compass evolved from the realization that when lodestone was placed on a piece of floating wood, the lodestone would always end up pointing in the same direction.
Over time man discovered the compass needle. A compass needle is a thin strip of metal, when stroked by a permanent magnet become magnetized. This made the compass a lot more precise, as it was able to rotate freely, after it was balanced on a pivot. They found that it always faced North, after it has settled.
3. sio.midco.net website
There appears to be some Asian history that goes back as far as 400BC. There is records to indicate that as far back as 400BC there were in fact working models of the compass in China. Evenly the Chinese used it for fortune telling, and they too used lodestone as part of their compass.
In general the compass' primary use is for direction purposes. Lodestone was used as it is a type of iron ore and contains elements that have magnetic properties. It has the ability to point to our largest magnetic pole, The North Pole.
The directional compass was first written about in the manuscript 'On The Natures Of Things (1190)'. By 1225 it was used in Iceland and in general use by navigators by the start of the 13th century.