A small muscle in the dermis of the skin that is attached to the base of a hair follicle. Contraction of the arrector pili, in response to cold or fear, pulls the hair into a vertical position, thus trapping an insulating layer of air around the body and causing ‘goose flesh’ in humans.