Final answer:
The arrector pili muscle causes hair to stand on end, resulting in goosebumps as a reaction to cold or fear, controlled by the sympathetic nervous system.
Step-by-step explanation:
The muscle that causes the hair to stand on end when a person is cold or scared is known as the arrector pili. This response is controlled by the sympathetic nervous system and is a reflex that helps the body conserve heat or may occur during emotional responses like fear. The arrector pili is a smooth muscle that pulls on the hair follicles, making the hair stand up and causing goosebumps.