I recently got whacked in the thumb and my nail got all purpley and nasty in the middle. I was told I was lucky, because if it hit too far down, my whole fingernail could fall off. I’ve never known someone who’s fingernail/toenail had fallen off, but you hear about it as torture or simply the result of an accident, and it got me wondering:
Where do they come from? Fingernails and hair are made of the same material from what I understand, and hair grows from a root surrounded by glands…is it the same for fingernails? Is there a gland or something that produces them, or do they “just grow?” And if you loose one, does it grow back?
The ends of your fingers. 
Don’t you love the internet? http://www.e-fingernail.com/ :
“Each digit, finger or toe, has a flat plate of keratinized epithelial cells on its dorsal surface known as a nail. Each nail arises from a nail root consisting of the normal layers of cells seen in skin. The outer layer, stratum corneum, forms the nail cuticle. The nail rests on a bed of epidermis that lacks a stratum corneum, called the nail bed. The nail bed serves only to support the nail as it grows outward from the nail matrix. Cells of the nail matrix divide, move outward and cornify to become the nail plate. The nail plate then slides forward over the nail bed. As the end of the plate extends beyond the nail bed it is filed, trimmed or worn away.”