pointwise $\implies$ uniform? (Dini's theorem) Is this right?
If $f_{n}(x):C \rightarrow \mathbb{R}$ is continuous, $C$ is compact, and $f_{n}(x)$ converges to $f(x)$ pointwisely for each $x$ in $C$, and $f(x)$ is continuous, then $f_{n}(x)$ converges to $f(x)$ uniformly on $C$.
I thought that since $C$ is compact, and each $f_{n}, f$ is continuous, by extreme value theorem, there exists $c$ in $C$ s.t $f_{n}(c)-f(c)=\sup|f_{n}(x)-f(x)|$ and $f_{n}(c) \rightarrow f(c)$ as $n \rightarrow \infty$, so we get $\limsup|f_{n}-f|=0$.
I know that if I add a condition that $f_{n}$ is monotone, then this is Dini's theorem, but I don't know why we need that condition. Where am I wrong?
Probably the most prominent counterexample is the following. Let $f_n:[0,1]\to\mathbb{R}$ be such that

$$f_n(x)=\begin{cases}n^2x&amp; x\in[0,1/n]\\ 2n-n^2x&amp; x\in[1/n,2/n]\\0&amp; \text{otherwise}
\end{cases}$$

Then $f_n$ converges poitnwise to $f=0$ which is continuous but $||f_n-f||_\infty=n$ hence we do not obtain uniform convergence!

Edit: As you see here, the existence of $c$ u claimed is precsiley the point $c_n=1/n$. Particularly, $c_n$ depends on $n$, hence the argument with the pointwise convergence for a fixed $c$ fails.
Dini's theorem requires that the sequence $\{f_n(x)\}$ is monotone!  (it.wikipedia.org/wiki/Lemma_di_Dini)