Set of continuous maps is closed in set of all maps Given two metric compacta (this means compact Hausdorff) $X$ and $Y$, let $C(X, Y)$ be the set of all continuous mappings of $X$ into $Y$. Let the distance in $C(X, Y)$ be defined by 
$$d(f, g) := sup\{ d(f(x), g(x)) \}.$$
Let $M(X, Y)$ be the set of all mappings of $X$ into $Y$ with the same metric as above. Prove that $C(X, Y)$ is closed in $M(X, Y)$.
I know that $M \subseteq \bar{M}$ for any subset of a metric space. So I have to show $\bar{M} \subseteq M$.
The definition of the closure is that it is the set of all contact points and $x$ is a contact point of $M$ iff. each open ball with center $x$ contains a point of $M$ i.e each ball with center $x$ has non-empty intersection with $M$.
I know that the closure of $M$ equals the union of $M$ and the union of its limits points.
I also know that $x$ contact point of $M$ if and only if there is a sequence $(x_{n})$ in $M$ such that it converges to x.
And a metric space is compact if and only if it is totally bounded and compact.
So what I have to show is that given $f \in \bar{C(X, Y)}$, then $f \in C(X, Y)$. Since $f \in \bar{C(X, Y)}$, I know that there is a sequence $(f_{n}(x))$ in $C(X, Y)$ such that it converges to $f(x)$. That is about as far as I can get.
There is a hint to the problem, namely: Prove that the limit of a uniformly convergent sequence of continuous mappings is itself a continuous mapping.
 A: Asserting that $C(X,Y)$ is closed in $M(X,Y)$ is equivalent to asserting that if a sequence $(f_n)_{n\in\mathbb N}$ of elements of $C(X,Y)$ converges to some $f\in M(X,Y)$, then $f\in C(X,Y)$. But $(f_n)_{n\in\mathbb N}$ converges uniformly to $f$. Since each $f_n$ is continuous, it follows that $f$ is continuous too.
A: We prove that every sequence in $C(X,Y)$ that converges in $M(X,Y)$ converges to a function in $C(X,Y)$. 
Hence take one such sequence of functions $(f_n)$ and let $f$ be its limit in $M(X,Y)$. Let $d_Y$ be the metric in $Y$ and $d_X$ the metric in $X$. For any $x, y\in X$ and any $n\in\mathbb{N}$ note that, by the triangle inequality,
$$
d_Y(f(x),f(y))\leq d_Y(f(x),f_n(x))+d_Y(f_n(x),f_n(y))+d_Y(f_n(y),f(y)) \leq 2 d(f,f_n)+d_Y(f_n(x),f_n(y)).
$$ 
Now use the fact that $(f_n)$ converges in the uniform $d$ metric to $f$ and that all the functions $f_n$ are continuous to derive that, for every $\varepsilon>0$, there exists $\delta>0$ such that, for every $y\in B_{d_X}(x,\delta)$, it holds that 
$$
d_Y(f(x),f(y))<\varepsilon.
$$
