Athlete’s foot—the most prevalent foot fungus—thrives in warm, sweaty places like the insides of your athletic shoes, which is how it got its name. However, foot fungus can develop in multiple environments, natural and man-made, as long as there is lots of moisture where fungi can grow. These include shared areas at gyms or pools, soil and grass, or even shared items such as shoes, socks, or towels from household members who are infected.  
If you have diabetes, you may have reduced blood circulation and nerve supply in your feet. You're also at greater risk of a bacterial skin infection (cellulitis). So any relatively minor injury to your feet — including a nail fungal infection — can lead to a more serious complication. See your doctor if you have diabetes and think you're developing nail fungus.
×