A nipple is the small projection of skin at the tip of a breast. Its biological function is to pass milk through from the 'milk sacs' behind the nipple, which is in turn produced by milk glands still deeper in the breast. Milk production is normal in females after pregnancy and birth, but both men (rarely) and women (much more commonly) can lactate at other times. Female nipples are characteristically larger (diameter and length) than male nipples, but there is considerable variation.
Its erotic function is rather more flexible. Nipples are well supplied with nerves and some people (almost always women) can become quite aroused by stimulationg them (eg, sqeezeing, pinching, nibbling, sucking, etc). Some can even reach orgasm from such stimulation. Pierced nipples are sommonly reported to be more sensitive than before, and more continuously stimulated, even in ordinary situations.
Nipples in both males and females are capable of erection, but the mechanism is different than for penises and clitorises, which are spongy tissue which fills with blood. Being without hydraulic mechanisms, nipple piercing is eminently possible for those interested. Nipples erect through the contraction of muscles in the nipple. Because these muscles will be cut at least to some extent by a nipple piercing, it should be expected that post piercing erection will be somewhat physically different than before.