A nowhere continuous function that maps compact sets to compact sets

121 Views Asked by At

Construct an example of a function $f:\mathbb{R}\to \mathbb{R}$ that is not continuous at any point, but satisfies the property "$f(K)$ is compact, when $K$ is compact" however $f(\mathbb{R})$ is not compact.

I have an exam on Wednesday and was given back a HW problem in which I missed, but got no instruction as to why I did so. I am worried something similar might appear on the test and was wondering if anyone had any ideas on how I should attack the problem above.

1

There are 1 best solutions below

0
On

Let $1_{\Bbb Q}$ be the indicator function (characteristic function) of $\Bbb Q$, and let $f(x)=\lceil |x|\rceil 1_{\Bbb Q}$ for each $x\in\Bbb R$. If $K\subseteq\Bbb R$ is compact, then $K$ is bounded, and $f[K]$ is finite, but $f[\Bbb R]=\Bbb Z$.