# 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.