Hello,
Welcome to ehealthforum
Black toenails can be due to any injury,trauma to nail which causes the blood to accumulate or fungal infection.This can also occur if someone does a lot of unaccustomed activity such as walking or sports, especially if the shoes are not a good fit. Some suggestions:
Keep your feet covered if you are visiting any public place as swimming,gym etc
Always dry the feet before putting shoes.
Wear good fitting shoes.
Consider visiting a Physician for examination so that if fungal infection is present it can be treated accordingly.
Take Care!