I already proved the first statement:
If $M$ is compact $\Rightarrow$ every positive continuous function $f:M\rightarrow \mathbb{R}$ has positive infimum.
Now, I need to prove the converse: If $M$ is a metric space such that every positive continuous function $f:M\rightarrow \mathbb{R}$ has positive infimum, so $M$ is compact.
I found this question here: $M$ is compact iff $f:M\to\mathbb{R}$ has a positive infimum.
But I want to prove this without using pseudocompactness, and this question uses. Can someone just give me some hints? I really don't want the answer itself.