## Does Pointwise Convergence to a Continuous Function Imply Uniform Convergence?

Recently in my advanced calculus class we discussed how the uniform limit of a sequence of continuous functions is itself continuous.  One of my students turned the question around: If the limit of a pointwise sequence of continuous functions is continuous, does that mean that the convergence is uniform?

The answer is “No,” although I couldn’t think of a counterexample off the top of my head.  I found one (not surprisingly) on Math.SE.  Although there are some good discussion and multiple good answers to this question given there,  I’m going to discuss Ilmari Karonen’s answer.

Let $\displaystyle f_n: [0,1] \mapsto \mathbb{R}$ be given by

$\displaystyle f_n(x) = \begin{cases} nx, & 0 \leq x \leq 1/n; \\ 2 - nx, & 1/n < x \leq 2/n; \\ 0, & \text{ otherwise}. \end{cases}$

Each $f_n$ is continuous (piecewise, but that’s fine).  For any $x \in (0,1]$, there exists N such that $x > 2/n$ for all $n \geq N$.  Since $f_n(0) = 0$ for all n, this means that $f_n(x) \to 0$ for all $x \in [0,1]$.  The zero function is clearly continuous.

However, for each $n \in \mathbb{N}$ we have that $f_n(1/n) = 1$.  This means that when $\epsilon < 1$ there cannot be an $N \in \mathbb{N}$ such that $|f_n(x)| < \epsilon$ for all $x \in [0,1]$ and $n \geq N$.  Thus the convergence cannot be uniform.

An even more simpler example is $$f_n: (0,1) \mapsto [0,1)$$, where $$f_n(x)=x^n$$. $$f_n(x)$$ is clearly continuous and converges to $$0$$ on $$(0,1)$$ (again continuous point-wise), whereas the convergence is not uniform.
I think in class we had restricted ourselves to closed and bounded domains for $\{f_n\}$. But you’re right; for the question I stated in the post that is definitely a simpler example.