Let $X$ a topological space, A ⊆ X compact and $f : A → \mathbb{R}$ a continuous function with the property that $f(a) > 0$, $∀a ∈ A$. Show that there is a $c > 0$ such that $f(a) ≥ c, ∀a ∈ A$. I thought to use the fact that if $A$ is compact then $f$ is bounded and $f(A)$ is closed, so there is $x_1\in A$ such that $f(x_1)=\inf f(X)$ and if I know that for any $a\in A$ the function is bigger than zero, then $\inf f(x) \geq 0$. It seems to simple to be true however.
More on the result I used here $X$ compact metric space, $f:X\rightarrow\mathbb{R}$ continuous attains max/min
Did I give a complete proof?