# A question on metric spaces

Let $X$ and $Y$ be two metric space and $f:X\to Y$ a function. Let $f:K\to Y$ be continuous for every compact set $K$ of $X$. Is $f$ continuous?

-

HINT: For any $x\in X$ and any sequence $\langle x_n:n\in\Bbb N\rangle$ converging to $x$, the set $\{x\}\cup\{x_n:n\in\Bbb N\}$ is compact.

Added: Use this to show that if $\langle x_n:n\in\Bbb N\rangle$ converges to $x$ in $X$, then $\langle f(x_n):n\in\Bbb N\rangle$ converges to $f(x)$ in $Y$.

-
Please explain. – aliakbar Feb 14 '13 at 9:26
@aliakbar: What do you know about continuous functions and convergent sequences? – Brian M. Scott Feb 14 '13 at 9:26

The positive answer to this question should be seen as the result that every metric space, in fact every first countable space, is a $k$-space, or to use another commonly used term, is compactly generated.

The point is that that the category with objects Hausdorff topological spaces and morphisms the functions continuous on compact subspaces has some convenient properties not held by the usual category of topological spaces. For example, in this category, the product of identification maps is an identification map.

More background to this question is for example in the book Topology and Groupoids, Section 5.9, which also drops the Hausdorff assumption.

-