Fungal nail infection may produce black pigment, as seen here. More commonly the dark colour is due to traumatic haemorrhage, but the possibility of malignant melanoma has to be remembered also. The trauma may originate from unnoticed minor repeated pressure from (sport) shoes.