Q:

Show that $\forall f\in C(X)\ \ f(x_n) \to f(x)\implies x_n \to x$.

I'm working on a problem which amounts to showing that if $X$ is a compact metric space and $C(X)$ is the space of continuous functions $X\to\mathbb{R},$ 
$$\forall f\in C(X)\ \  f(x_n) \to f(x)\implies x_n \to x$$
I've done a fair amount of functional analysis (with weak and weak* convergence) but I'm not sure that this result is true. 
If it isn't, please let me know, otherwise, I would appreciate a hint to get me started.

A:

Let $X$ be a compact metric space.
Assume there exist a sequence $(x_n)$ in $X$ not converging to a point $x\in X$ having the property:
We consider the following continuous (help) function $h:X\to \Bbb R$, defined for $y\in X$ by
$$
h(y):=d(y,x)\ .
$$
It is continuous because of
$$
|h(y)-h(y')|=|d(y,x)-d(y',x)|\le d(y,y')\ .
$$
(The last is true, because it is equivalent to $-d(y,y')\le d(y,x)-d(y',x)\le d(y,y')$, and each $\le$ reduces equivalently to a triangle inequality.)
It is given that $h(x_n)\to h(x)$, i.e. $d(x_n,x)\to 0$. This implies $x_n\to x$.
Contradiction...

