What is the evolution of hairs? Did they evolve from scales?
From a little research I have been able to find some of the hypotheses and speculations but no papers expressly confirming or denying the matter.
One theory displayed in "The evolution of mammalian keratinized structures" (abstract only) is that mammalian hair developed along the following pathway:
So this paper would suggest that hair production evolved separately from but parallel to the movement away from reptilian scales.
"Some Speculations on the Evolution of the Vertebrate Integument" (Paul F. A. Maderson) suggests an entirely different origin of hairs. He proposes that hairs ultimately evolved from sensory appendages that were involved in the detection of temperature in early synapsids. The extension of these micro-limbs into hairs was selected towards as a result of their thermally insulating effect by-product rather than for their sensory role, however.
As to the early evolution of mammalian hair, Rowe et al. (2011) hypothesized that the primitive function for hair was not thermoregulatory, but rather for tactile sensation (contra the hypotheses of Spearman and Maderson). Rowe et al. say:
So the developmental argument is in favor of tactile sensation.