Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am stuck on this question (probably there are many counterexamples, but I can't find any).

"Suppose $f:\mathbb{R}\mapsto\mathbb{R}$ that preserves compactness (i.e, for every $K \subseteq R$, then $f(K)$ is compact). Is $f$ continuous?"


share|cite|improve this question
Just wanted to point out that the inverse direction is indeed true: the image of a compact set $K\subset\mathbb{R}$ under a continuous function $f$ is compact (iow $f(K)\subset\mathbb{R}$ is compact). $\ddot\smile$ – b00n heT Jan 31 '14 at 22:19
up vote 12 down vote accepted

$f(x) = 1$ if $x$ is rational, otherwise $f(x)=0.$ So $f(K)$ is either one or two points.

share|cite|improve this answer
@Dror: There are plenty. This function, while not continuous, is the pointwise limit of continuous functions. One can find functions which are not even Borel measurable. That means that they are far far less continuous than this one. – Asaf Karagila Jan 31 '14 at 22:25
Will, of course. It's when you're drunk you start flirting with the idea that every function is Borel measurable. – Asaf Karagila Jan 31 '14 at 22:26
As long as it's not light beer... – Asaf Karagila Jan 31 '14 at 22:30
Hey @WillJagy, I got it. thank you all for the comments! – user125303 Jan 31 '14 at 22:35
@Dror: I am talking about functions $\Bbb{R\to R}$. There are only $2^{\aleph_0}$ functions which are Borel (which turn out the be the smallest class of functions containing all the continuous functions and closed under pointwise limits), so most of the functions are even "less continuous" than that. If you want to be slightly more "specific", pick any non-measurable subset, e.g. a Bernstein set or a Vitali set, and consider its indicator function. – Asaf Karagila Jan 31 '14 at 22:36

Floor function should be another example. The image of each compact (bounded) set is a finite discrete set and therefore compact.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.