Final answer:
The arrector pili are the muscles connected to hair follicles that contract to aid in temperature regulation by trapping more air against the skin, which insulates and causes goosebumps.
Step-by-step explanation:
The muscles attached to hair on your skin that aid in temperature regulation are D. arrector pili. These small, smooth muscles are connected to hair follicles. When the body is cold, they contract in response to stimuli from the sympathetic nervous system, which causes the hair to stand up. This traps more air against the skin, providing additional insulation and aiding in temperature regulation. These contractions also cause the appearance of goosebumps on the skin. The arrector pili muscles do not secrete sweat or sebum; those functions are served by different glands in the skin. Instead, their primary role is in thermoregulation and providing an involuntary physical response to emotional states, such as fear or being cold.