Compact convergence 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?
 A: 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$.
A: $f$ is clearly continuous on all compact subsets of $X$, so this is true whenever $X$ is compactly generated, which includes most cases of practical interest.
It is false in general. Let $X$ be an uncountable set equipped with the cocountable topology (the closed subsets are precisely the at most countable subsets and $X$). The compact subsets are precisely the finite subsets (exercise), each of which has the discrete topology, hence every function out of $f$ is continuous on compact subsets, and a sequence of functions $f_n : X \to Y$ converges uniformly to $f$ on compact subsets if and only if it converges pointwise to $f$. It is not hard to construct a counterexample from here.
I lied; my choice of $X$ above can't lead to a counterexample. The problem is that the preimage of every open set in $Y$ must be a cocountable subset of $X$, so if $Y$ is a Hausdorff space with more than one point in it, there are two disjoint open subsets $U, V$ of $Y$ whose preimages in $X$ cannot be disjoint, so every continuous function from $X$ to a Hausdorff space is constant. 
