Thank you for the question.
There are various conditions that can cause a dark discolouration of the nail.
A blood clot or haematoma under the nail can cause a dark discolouration of the nail. This usually appears suddenly and is due to trauma to the nails. On closer inspection, the colour may be black or dark purple. This usually improves as the nail plate grows.
A subungual melanoma or melanoma under the nail plate can also present as pigmentation beneath the nail plate.
Melanoma is one of the most serious forms of skin cancer and it is important to diagnose this early. This usually presents as a slowly enlarging pigmented growth beneath the nail. There is no history of preceding trauma.
The colour may be variegated or uneven and the edges are irregular. Unlike a subungual haematoma, this will not improve as nail plate grows and will gradually increase in size.
A pseudomonas nail infection can present with dark discolouration of the nail. On close examination, there is a dark greenish hue to the discolouration. This is due to colonization under the nail by the pseudomonas bacteria.
If in doubt, you can see your doctor or dermatologist for a closer examination to confirm the diagnosis.