My speedometer works - but only sometimes.
Most of the time it stays at 20mph and does not record the mileage.
Likely it is a sensor or wiring problem (if it is a mechanical speedometer, then that would be a cable issue or maybe a speedometer head.