Does pointwise convergence to a continuous function on a closed interval imply uniform convergence? Let's suppose that $(f_n)_{n}$ is a sequence of continuous functions that converges pointwise to a continuous function $f(x)$ on a closed interval $[a, b]$. Is then the convergence uniform, too?
If it is so, how do you prove it? If it isn't, could you give a counterexample, please?

My attempt
I managed to write down the hypothesis in symbolical terms, but could not go beyond that:


*

*continuity of the sequence  ($x_0\in[a, b]$):


$\forall n, \ \forall \epsilon >0 \ \ \exists \delta>0 \  : \ |x-x_0|<\delta \Rightarrow |f_n(x)-f_n(x_0)|<\epsilon $


*

*continuity of the limit function ($x_0\in[a, b]$):


$\forall \epsilon >0 \ \ \exists \delta>0 \  : \ |x-x_0|<\delta \Rightarrow |f(x)-f(x_0)|<\epsilon $


*

*pointwise convergence:


$\forall x\in[a, b], \ \forall \epsilon >0 \ \ \exists n_\epsilon>0 \  : \ n\geq n_\epsilon \Rightarrow |f_n(x)-f(x)|<\epsilon $
The thesis should be:
$\forall \epsilon >0 \ \ \exists n_\epsilon>0 \  : \ n\geq n_\epsilon \Rightarrow |f_n(x)-f(x)|<\epsilon \ \ \forall x\in[a, b]$

Note
Please do not bring sequences such as that of $x^n (x\geq 0)$ as a counterexample, because they are not counterexamples:
$\text{for  } n \rightarrow \infty , \ x^n \rightarrow f(x)= \begin{cases}
0 & \text{if  } 0 \leq x<1 \cr
1 & \text{if  } x=1
\end{cases}$
so there is a pointwise convergence to $f(x)$ on $[0, 1]$; but $f(x)$ - the limit function - is not continuous, then this example lacks the conditions for the theorem to be applied.
 A: As Adayah's counterexample shows, this does not work without extra hypotheses. However, if the pointwise convergence is monotone, then a classical theorem of Dini shows the convergence is indeed uniform.
A: Another example is $$f_n(x)=\begin{cases}
n^2x&0\le x\le\frac{1}{n},\\
2n-n^2x&\frac{1}{n}\le x\le\frac{2}{n},\\
0&\frac{2}{n}\le x\le 1
\end{cases}
$$
The graph looks like a triangle of height $n$ and base $2/n$ so the $\int_0^1f_n(x)\mathrm{dx}=1.$  If the convergence were uniform, the integrals would go to $0$.
A: Check out $f_n(x) = nx e^{-nx}$ on $[0, 1]$.
A: It might help to think of the negation of uniform convergence. Given a sequence $f_n$ and a limit function $f$, $f_n$ does not converge uniformly to $f$ if there is an $\epsilon$ such that for all $N$, there exist $k$ and $x_k$ such that $k>N$ and $|f_k(x_k)-f(x)|>\epsilon$. That is, to disprove uniform convergence, it suffices to find an infinite sequence of pairs $(n,x_n)$ such that $f_k(x_k)$ does not go to zero. An example would be $f(x) = 0$, $x_k = 2^{-k}$ with $f_k$ chosen such that $f_k(x_k)$ is equal to a constant. To make this converge pointwise to $f$, it suffices that each $x$ has nonzero $f_k(x)$ for only finitely many $k$. Or, we can make it even simpler and have only one such $k$ for each $x$. This can be done by having $f_k$ be zero for all but an interval of length $10^{-k}$ centered at $x_k$. It is then simple to construct continuous functions that satisfy these conditions.
BTW, "converges pointwise" is more standard than "pointwisely converges", and "attempt" rather than "trial".
