The primary and most common cause is a fungal infection which can lead to brownish or yellowish discoloration of the nail. Often the toenail might also get separated from the nail bed due to the fungal infection. Individuals going to gyms, spas, swimming pools and other such public places and walking barefoot are prone to such infections.