Continuity in a compact metric space.

The problem with your proof is that you cannot fix $x'$ and vary $\epsilon$. This is because $x'$ is conditioned on your given $\epsilon$.

As for a correct solution note that $|f(x) - g(x)|$ is a continuous function from $X$ to $\mathbb{R}$. What do you know about the minimum of a continuous function from a compact space to $\mathbb{R}$?


Your flaw is in assuming that the values $f(x')$ and $g(x')$ are fixed; they are not, since $x'$ depends on $\varepsilon$.

To prove the claim you just need to observe that $|f-g|$ is a continuous function (since it is the composition of continuous functions) which is positive, and that it is defined in a compact set, so it attains its minimum there, and...


Denying we have: given $k > 0$ there exist's $x_k$ such that $|f(x_k) - g(x_k)| < \frac{1}{k}.$ Make $x = (x_k).$ Since $M$ is compact, we have that $x$ must have a convergent subsequence to some $y \in M$. Then passing to the subsequence we must have, using continuity of $f,$ and $g$, that $g(y) = f(y)$. What is a contradiction.