The apartment wasn't cleaned out before you occupied it?
I would suggest a thorough steam cleaning, I think they have some sanitizing formulas. You need to be aware of what kind of carpet it is. From your statement I take it that it is probably a cheap synthetic, so you don't have to worry as if it were a fine wool carpet.
I personally would probably go with a solution of boric acid, wear a face mask and protective clothing to reduce contact with it, then thoroughly rinse the carpet with clear water in the steam machine (I own one). But then I tend to do things that are not all that safe. Boric acid is just the first thing that comes to mind to kill off any foot fungus.
Someone feel free to contradict me if they think it would be too dangerous. Also, whatever you use, you'll need to check for colorfastness.