The sudden black discoloration is likely due to trauma to the nail bed that causes bleeding beneath the nail. The trauma is normally due to repetitive stress to the nail from a tight gym shoe. If the nail is loose or more than 50% of the nail is black, it is best to visit a podiatrist.