TITLE: Compact convergence
QUESTION [5 upvotes]: Suppose $X$ is a topological space, $Y$ is a metric space, $f$ is a function from $X$ to
$Y$, and $\{f_n\}$ is a sequence of continuous functions from $X$ to $Y$ that converges
uniformly to $f$ on all compact subsets of $X$.  Must $f$ be continuous?

REPLY [6 votes]: Here’s a Hausdorff $-$ in fact perfectly normal $-$ counterexample.
Let $X=\{p\}\cup(\omega\times\omega)$, where $p\notin\omega\times\omega$. For $n\in\omega$ let $V_n=\{n\}\times\omega$. Topologize $X$ as follows: points of $\omega\times\omega$ are isolated, and a set $U\subseteq X$ is a nbhd of $p$ iff $p\in U$ and there is an $m\in\omega$ such that $V_n\setminus U$ is finite for each $n\ge m$. (In other words, $U$ must contain all but finitely many points of all but finitely many of the ‘columns’ $V_n$.) The compact subsets of $X$ are precisely the finite subsets. That $X$ is perfectly normal follows from the fact that it is zero-dimensional, since it has a clopen base. (This $X$ is sometimes known as the Arens-Fort space.)
Let $Y=\{0,1\}$ with the metric inherited from $\mathbb{R}$. For $k\in\omega$ define $f_k:X\to Y$ as follows: $$\begin{align*}
f_k(p)&= 0\\
f_k(\langle n,m\rangle)&=\begin{cases}
1,&n\le k\\
0,&n>k\;.
\end{cases}
\end{align*}$$
Then $\langle f_k:k\in\omega\rangle$ converges uniformly on compact sets to the function $g:X\to Y$ given by $g(p)=0$ and $g(\langle n,m\rangle)=1$ for all $\langle n,m\rangle\in\omega$, which is clearly discontinuous at $p$.