Recall Dini's Theorem:
Let $K$ be a compact metric space. Let $f: K\to\mathbb{R}$ be a continuous function and $f_{n}: K\to\mathbb{R}$, $n\in\mathbb{N}$ be a sequence of continuous functions. If $\{f_{n}\}_{n\in\mathbb{N}}$ converges to $f$ and if $f_{n}(x)\geq f_{n+1}(x)$ for all $x\in K$ and all $n\in\mathbb{N}$, then $\{f_{n}\}_{n\in\mathbb{N}}$ converges uniformly to $f$.
It is known that the hypotheses:
- $K$ is compact
- $f$ is continuous
- $f_{n}(x)$ decreases as $n$ increases
are necessary. See this document.
Me and my friend are looking for an example where:
- $K$ is compact
- $f$ is continuous
- $f_{n}(x)$ decreases as $n$ increases
- $f_{n}$ are not continuous
- $f_{n}\to f$ pointwise, but $f_{n}$ does not converge uniformly to $f$
We have been thinking for 2 hours, but to no avail!
Here is a modified version of David Mitra's answer from this thread.
$$ f_n(x)=\begin{cases}-1 & 0\le x\le 1-{1\over n}\cr 0&1-{1\over n}< x<1\\-1\;&x=1\end{cases} $$
answers the question. The limit function is the constant function $f=-1$.