Piloerection compounds the insulating properties of the hair coat by changing its thickness. It minimizes heat loss primarily through radiation and secondarily through convection, and makes it possible for animals to compensate for moderate cooling of the environment without increasing their metabolism.
How does piloerection keep you warm?
Piloerection (goosebumps).
In response to increased sympathetic nerve discharge, the arrector pili muscles at the base of tiny hairs in the skin contract and cause the hairs to become upright, trapping air and thus increasing the insulating layer of air around the body and minimizing heat loss.
What is piloerection and how it helps in controlling the body temperature?
They are due to piloerection, the erection of the hair follicles on the skin. This is a vestige of the time when humans were covered in hair: piloerection would trap air and retain heat. Body temperature is regulated by a system of sensors and controllers across the body.