TITLE: Does convergence on finite intervals imply uniform convergence?
QUESTION [6 upvotes]: Let $f_n(x) \rightarrow 0$, $n\rightarrow \infty$ for all $x \in \mathbb{R}$.
Does this imply $f_n(x) \rightarrow 0$ uniformly on finite intervals?
I could think it could be proofen like this maybe:

Let the interval $I$ be compact without loss of generalization
Choose a finite subcover for $I$
take $N := \sup N_j$ for the $\epsilon$-$\delta$-proof

But I am not sure if it is okay this way, or if it can be done more easy. Is it maybe a known lemma?

REPLY [4 votes]: The counterexample I usually use, and I like it aesthetically since it doesn't need a piecewise definition, is $$f_n(x)=4x^n(1-x^n)$$ for $x\in[0,1]$. $f_n(1)=0$ for all $n$, and $f_n(x)\le4x^n$ for all other $x\in[0,1]$.  However, $\|f_n\|_{L^\infty}=1$ for all $n$.