The athletes foot fungus is the same fungus that causes onychomycosis, or toenail fungal infections. In reality, there is not just one fungus that can do this, though a couple of species account for most infections. A group of fungi, collectively known as dermatophytes, cause fungal infection of the hair, nails, and skin.
It's common for fungus that has invaded the toenails to spread to the skin, or for it to spread in the other direction – from the skin to the nails. Odds are, if you have athlete's foot fungus and fungal toenails, the same fungus is causing the problem in both places. And since it is affecting the skin, it is almost certainly one of the common types of foot fungus – the dermatophytes. There are some other environmental fungi that occasionally infect the nails, but they do not invade the skin.
The good thing about this is that, in many cases, you can treat both athletes foot fungus and nail fungus with the same remedy. In general, the fungus remedies do not distinguish between the different types of foot fungus, operating on the assumption that what kills one will kill them all. With some remedies you may need to make adjustments; for example, applying pure Tea tree oil may be okay for nails, but you could have a problem with skin sensitivity if you do not dilute it with a carrier oil before applying it to your skin. Similarly, if you're using hydrogen peroxide for foot fungus, spraying on the skin is probably fine, but to penetrate an infected toenail, you'll need to soak.
The easiest choices will be treatments that will work for both types of foot fungus – the athletes foot fungus and the nail infection, with one application. Penetration of the nail by the remedy is always a problem, so choose a soaking method, which will soften the nail, or an oily topical treatment, and plan to spend some time filing down the nail and removing bits that break off so that there is less thickness for the remedy to get through.
The athletes foot fungus will probably clear up much faster than the nail infection because the skin infection is superficial and the treatment easily contacts the fungus there. To get rid of both types of foot fungus, however, you will have to keep up the treatment until the nails look good as well. Nail fungal infections are notorious for the length of time they take to resolve. If your athletes foot fungus is gone and there is any sign of improvement in the nails, the treatment is working. Keep it up and you will eventually succeed.