Once you suspect that your toenail is coming off, first check for bleeding and discoloration underneath the nail. This is what is causing the pain. The toenail may have been affected by Dermatophytes or injuries sustained while soccer, skating. Visit a hospital and have it checked.
Well you're either wearing shoes a few sizes to small, you dropped something heavy on your foot, you have a foot fungus amungus, poor circulation, gout, diabetes, an infection, gang green or a few other fun filled things. Pick up the phone and visit your MD or go directly to a podiatrist