Though hair and fingernails appear to keep growing after death, this is merely a morbid optical illusion at work.
In death the human body dehydrates severely, retracting enough skin to expose more nail and hair.