1. We recognize people by their hair - its length, colour and style. When you first meet two men or women with the same hair it can be hard to tell them apart. The use of hair in recognition has been confirmed in some studies of infants, and monkeys (using human faces).
2. But using hair for recognition is strange and not ideal because hair is so changeable! This is particularly the case nowadays, when changing fashion and hair colouring technology make it possible and usual for someone to undergo radical change in their hair; but hair changes anyway over a timescale of weeks as it grows, and over the years due to development and ageing.
3. On the face of it (!) this doesn't make sense - why use hair for recognition when somebody's hair is so changeable? - but we do.
4. Perhaps what does not make sense in adults does make sense in babies - and the recognition-by-hair instinct we find in modern adults is substantially left-over from something which was adaptive to infants (under ancestral conditions)?
5. Babies have poor eyesight, poor visual acuity. Maybe hair length, style, shape is the only thing that infants can clearly see? (Maybe this applies to adults too - at a distance?)
6. So, maybe the use of hair in recognition is the best that can be done under the circumstances of an infant.
(That is, with an infants eyesight, over the short timescale of an infant's awareness, and under ancestral conditions - when there were not many humans in the social world, and where they were mostly differentiated by sex and age - and perhaps each human in the social world therefore had distinctive hair.)
Note: the key step in the above analysis is number three - recognizing that something is real and apparently instinctive (spontaneous, natural, seemingly universal) yet does not make sense. That is often the basis of an interesting and potentially useful evolutionary theory. This came from my son Billy, as did the hypothesis in point five - the rest was a collaborative discussion.
Another example of this kind of thing would be the paradox that men are attracted to prominent breasts in women (this is not functional because woman's breasts are prominent due to fatty tissue - not glandular tissue) - but prominent breasts in other primates signal pregnancy or lactation - so prominent breasts are a signal of NON-fertility. Why would a signal of non-fertility become sexually attractive?
I heard this problem first formulated by Nikolas Lloyd nearly twenty years ago, but I haven't yet come across what I would regard as a plausible answer http://www.lloydianaspects.co.uk/evolve/breasts.html.