5

A continuous function maps a compact set to a compact set. Is the converse of this true? That is, is a function that maps every compact set to a compact set necessarily continuous?

3 Answers3

22

No. Consider the discontinuous function $$f(x) = \begin{cases} 1 & x \geq 0\\ -1 & x <0.\end{cases}$$ Then for any subset $A \subseteq \mathbb{R}$ (not just compact subsets), $f(A)$ is either $\emptyset$, $\{-1\}$, $\{1\}$, or $\{-1, 1\}$, all of which are compact.

8

The characteristic function of the rationals maps every set, in particular every compact set, to a compact set. But it is discontinuous at every point.

zhw.
  • 107,943
5

The most bare-bones counterexample is probably the identity function from a two element set equipped with the trivial topology to a two element set equipped with a nontrivial topology.

Alex Provost
  • 21,651