Goosebumps refers to the little bumps that appear on our skin when we're cold or emotional. They're caused by the contraction of a tiny muscle (called the erector pili muscle) that lies at the base of each hair. The muscle causes the hair that it is connected to to stand upright, like a soldier to attention. As it contracts, the muscle shortens into a tiny compact ball, which causes the skin to resemble a goose's skin - hence the name. There's a nice picture of this on the right. The erector pili muscle is the pink strip attached to the hair's right-hand side.
But why do we get goosebumps? What function do they have?
As it turns out, absolutely none. Goosebumps are what is known as vestigial - that is, they are functionless leftovers from our ancestral past. In animals which have much more hair than us (a category that certainly includes our ape-like ancestor), the effect of making the hairs stand up is to trap a layer of air under them. And, as with human clothes, keeping a layer of air near the animal warms it. (The skin loses heat to the air, but instead of moving away and being replaced with new air -which would start the process again and cause more heat loss - the air stays put.)
Apart from cold, another trigger for goosebumps is strong emotions, the sort to trigger the sympathetic fight-or-flight response. When the hairs stand erect in hairier animals, it makes the animal look bigger and more threatening. It's a sort of bluff that aims to help the animal get its way.
However, humans don't produce enough bodily hair for either of these adaptations to work. In us, they're just useless relics of an ancient past.