Question
Given a sequence of continuous functions $(f_n)_{n \in \mathbb N}$ and define $$ f : X \rightarrow Y, \quad f(x) = \lim_{n \rightarrow \infty} f_n(x) $$ where $X$ and $Y$ are metric spaces.
If $f$ is continuous, is it true that $(f_n)$ converges uniformly to $f$?
Are there any restrictions on $(f_n)$, $f$, $X$ and/or $Y$ for this to be true?
Thoughts
This seems like a very useful result, yet it does not seem to be mentioned anywhere which leads me to think it is either completely obvious, or false. This site usually has a question or two pertaining to 'obvious' results, and my attempts to find them have been unsuccessful, though I have found Dini's theorem which relaxes the condition of continuity but requires the sequence to be monotonic and $X$ to be compact.
I know this statement is false if $(f_n)$ are discontinuous functions. Take as counter-example $$ f_n : \mathbb R \rightarrow \mathbb R, \quad f_n(x) = \begin{cases} x^n & x \in [0, 1) \\ 0 & \text{Else} \end{cases} $$ then $f \equiv 0$ is continuous, but $(f_n)$ does not converge uniformly to it.
I have attempted a proof below, and if nothing is wrong, then we require that $X$ is compact.
Attempted Proof
We wish to show that given $\varepsilon > 0$, there exists an $N$ such that for $n > N$, then $$ \forall x \in X, \quad d(f_n(x), f(x)) < \varepsilon. $$
Since $f_n$ are continuous, then for $x \in X$, there exists a neighbourhood $N_x \subseteq X$ such that $$ \forall y \in N_x, \quad d(f_n(x), f_n(y)) < \varepsilon $$ and similarly with $f$.
Additionally, we know that for $x \in X$, there exists $N(x) \in \mathbb N$ such that $$ \forall n > N(x), \quad d(f_n(x), f(x)) < \varepsilon $$
We now set $\varepsilon > 0$, and suppose there does not exist an $N$ such that for $n > N$, then $\sup_{x \in X} \{d(f_n(x), f(x))\} < \varepsilon$. This means we can always pick some $x_0 \in X$ such that $d(f_n(x_0), f(x_0)) \geq \varepsilon$.
By the triangle inequality, we have that $\forall x \in X$ $$ d(f_n(x_0), f(x_0)) \leq d(f_n(x_0), f_n(x)) + d(f_n(x), f(x)) + d(f(x), f(x_0)) $$ As $f_n$ and $f$ are continuous, then we can pick $x$ in a neighbourhood such that the first and third term are less than any $\varepsilon > 0$. In other words, we have that $$ d(f_n(x_0), f(x_0)) < d(f_n(x), f(x)) $$ Thus in the neighbourhood of any 'badly behaving' point, there exists another badly behaving point.
If we require $X$ to be compact, then there exists a point $y \in X$ such that $d(f_n(y), f(y)) = \sup_{x \in X}\{ d(f_n(x), f(x)) \}$ (since $f_n$, $f$ and $d$ are all continuous, thus the image of the distance function must be compact too), in which case the above result would lead to a contradiction.
--
Some of the answer have shown the proof to be false. Why?
Mike's example, in fact, generalizes significantly.
Let $V_n\subseteq U_n$ be a closed set inside of $U_n$; it is not too hard to show that one must exist. Since $X$ is a metric space, it is normal, and so Urysohn's Lemma guarantees the existence of a continuous function $f_n$ that is $1$ on $V_n$ and $0$ on $(U_n)^c$.
Evidently, $f_n\to 0$, since every point is mapped to zero by all functions except possibly one. However, it is also clear that $\max_x|f_n-f|=1$, and so the convergence is not uniform.
(I believe you can replace the disjoint sequence of sets condition with $|X|=\infty$: relax it to be a sequence of points, and then I'm pretty sure the sequence is either discrete or it has a Cauchy subsequence. If it is discrete then we expand the points to disjoint open sets and we're good. If it has a Cauchy subsequence then pass to that subsequence and we can build the sets inductively by putting an closed set around the limit point so that there are only finitely many sets to consider. Normality kicks in and we're still good.)
EDIT: It may generalize in another direction as well. The concept of uniform convergence most generally makes sense in uniform spaces. In general a uniform space need not be normal, but it must be Tychonoff, and this question shows that Urysohn's Lemma almost holds in that setting. Since singletons are compact in Tychonoff spaces, we should be able to repeat the argument. But I have not worked much with uniform spaces and so I may be missing some subtleties.