Simple Compactness and Continuity Proof Verification I'm given the following:
Let $X$ be a compact metric space, $g:X\rightarrow\mathbb{R}$, $g$ continuous and $g(x)\ne0$ $\forall x\in X$.
And I need to prove that there exists $\delta>0$ such that $|g(x)|\ge\delta$ $\forall x\in X$.
I've gone about it using a few results.
Proof: Consider $|g|:X\rightarrow\mathbb{R}$. Since $g$ is continuous, $|g|$ is also continuous. Furthermore, since the image of a continuous function with a compact domain is itself compact, $|g|$ maps $X$ to a compact subset of $\mathbb{R}$. By Heine-Borel, compactness in $\mathbb{R}$ is equivalent to closed and boundedness. Then, since $|g(x)|$ is bounded from below, we can pick $\delta>0$ such that $\delta=\inf_{x\in X}|g(x)|$, so we get $|g(x)|\ge\delta$ for all $x\in X$.
Does this proof suffice?

Edit:
A real valued continuous function on a compact space attains its infimum (because $g(X)$ is compact in $\mathbb{R}$, hence closed and bounded), $\exists~p \in X $ such that $|g(p)|=\inf_{x \in X}|g(x)|$. This $|g(p)|>0$ by your assumption, so $\exists~\delta>0$ such that for any $x \in X$,   $|g(x)|\geq |g(p)|>\delta$.
