How can I avoid getting athlete's foot in a hostel?

Shoes. Along with the other answers, I would recommend taking along a pair of flip flops or sandals that are water proof (and slip resistant!) to wear in the shower and around the hostel. This will not only aid you in not picking up athlete's foot but keep you from inadvertently stepping on something that can cause a wound.