True hair is found only in the Class Mammalia, and there is really no such thing as an absolutely hairless mammal. Even whales (at least some of them) have rudimentary hairs here and there. Some other animals have hair-like structures, but if you have real hair, you're a mammal.
Hair serves many functions. The most obvious is to serve as insulation, but it's also used to provide camouflage (for example, the spot pattern
on a fawn deer mimics the play of light and shade on a forest floor), for sex recognition (male mammals often have ruffs, manes, or beards as secondary sex characteristics) and even for social purposes, such as aggressive display (as when a dog's "hackles rise" or a cat elevates her fur on the approach of a dog).
Hair grows from the hair follicle, not out of it. One point that needs to be emphasized is that the hair follicle and the hair it produces are part of the epidermal region of the skin. The follicle is separated from the underlying dermis and hypodermis by a basement membrane, and the hair itself grows from the germinal epithelium at the deepest part of an active follicle. Hairs don't grow "through" the skin. They grow from skin and in a very real sense they're part of the keratinizing system of the epidermal layer.
Reference: Dr. Thomas Caceci