Hair is made mostly out of a protein called keratin which is also found in skin. In each hair there is only a few living cells. Each hair grows out of a follicle, which is like a socket in the skin of your head. As the hair grows out of the follicle it is very soft but as it reaches the surface of the skin the hair becomes harder and full of keratin. Once a hair cell emerges from the skin, it is no longer living. A piece of hair is formed with three layers. The cuticle, which is the outer, transparent part of the hair. The cuticle is made out of a protective layer of hard cells arranged over tiny scales like the overlapping of roof tiles.
The next layer in the hair is the cortex. The cortex is made out of rod-like cells which form the thickness of each strand of hair. The cortex also holds a pigment which gives the hair it's colour. There are two main pigments, phaeomelanin, which is yellow or red, and eumelanin, which is brown or black. The colour is visible through the clear cuticle.
Pigments are produced in special cells called melanocytes. As people grow older these cells stop working so the hair becomes white.
The third layer of the hair is the medulla which is a soft and spongy core.
Hair is kept soft from an oil gland which is in the scalp.
As hair grows from the follicle it is soft and pliable. If the wall of the follicle is circular, then the hair grows straight. If the opening is not exactly circular the hair grows out wavy. If your hair is curly then the wall of your follicles is flat and rectangular.
Whatever the shape of your follicle wall is the shape of the tip of your hair under the microspope.