This is an introduction to the M\"obius function of a poset. The chief novelty is in the exposition. We show how order-preserving maps from one poset to another can be used to relate their M\"obius functions. We derive the basic results on the M\"obius function, applying them in particular to geometric lattices.