According to WebMD, a nail fungus develops when a microscopic fungus enters into the nail, and if the fungus causes an infection, the nail thickens and becomes discolored. Nail fungus infections are more likely to develop in toenails than in fingernails.
Nail fungus is not caused by poor hygiene, and these infections are more common in individuals over age 60, notes WebMD. Doctors can often determine if someone has a nail fungus infection by inspecting the nail carefully with or without a microscope. Pain might be present with the infection, although this is uncommon. Doctors generally prescribe a topical cream or an oral antifungal medication to treat this condition.