# $f:X\rightarrow \mathbb{R}$ surjective function. Is $f$ continuous?

Let $$X$$ be compact space and $$f:X\rightarrow \mathbb{R}$$ surjective function. Is $$f$$ continuous?

Im trying to prove it that it isn't continuous but I can't find the right example. So I tried:

Assume that $$f$$ is continuous. Then if $$X$$ is compact so $$f(X)$$ is. But since $$f$$ is surjective function, then $$f(X)=\mathbb{R}$$ and $$\mathbb{R}$$ is not compact. We get contradiction.

Am I thinking right? ( We consider $$\mathbb{R}$$ with natural topology)

• If you've covered that theorem, it's by far the easiest way to do it, yes. – Henno Brandsma Feb 2 '20 at 12:14

You really only have one property of a continuous function: the preimage of an open set is an open set. You really only have one property of a compact set: any open cover is a finite subcover. This means we need to find some useful collection of open sets in $$\Bbb{R}$$ whose preimages are an open cover of $$X$$ and find a way that only finitely many of them cover $$X$$ contradicts surjectivity...

Suppose, for purpose of contradiction, $$f$$ is continuous. The preimage of every open set in $$\Bbb{R}$$ is open in $$X$$. For every $$x \in X$$, define the unit length open interval $$U(x) = (f(x) - 1/2, f(x)+ 1/2) \subset \Bbb{R}$$ and note that $$f(x) \in U(x)$$. We have observed that $$f^{-1}(U(x))$$ is an open set in $$X$$. Since $$f$$ is a total function and each $$x \in X$$ satisfies $$x \in f^{-1}(U(x))$$, $$\bigcup_{x \in X} f^{-1}(U(x))$$ is an open cover of $$X$$. Since $$X$$ is compact this cover has a finite subcover. That is, there is an $$S \subset X$$ such that $$|S|$$ is finite and $$\bigcup_{x \in S} f^{-1}(U(x)) = X$$.

Since $$f$$ is surjective, $$f(X) = f\left( \bigcup_{x \in S} f^{-1}(U(x)) \right) = \Bbb{R} \text{.}$$ But $$f\left( \bigcup_{x \in S} f^{-1}(U(x)) \right)$$ is a union of a finite collection of unit length open intervals of $$\Bbb{R}$$. Since $$\Bbb{R}$$ cannot be covered by a finite collection of unit length intervals, we have our contradiction.

If $$f$$ is surjective, and $$X$$ is compact, then $$f$$ is not continuous: Pick $$x_n \in X$$ such that $$f(x_n)=n$$ for all $$n \in \Bbb N$$. (Does not even use the full force of surjectivity, btu it's all we need.)

As $$X$$ is compact, there is a point $$p \in X$$ such that for every open neighbourhood $$O$$ of $$p$$, $$N(O):=\{n \in \Bbb N: x_n \in O\}$$ is infinite. (This is called a point of complete accumulation of $$\{x_n: n \in \Bbb N\}$$.)

(Proof sketch : if no such $$p$$ exists, every $$x \in X$$ has an open neighbourhood $$O_x$$ with $$N(O_x)$$ finite. Take a finite subcover of $$\{O_x: x \in X\}$$ to derive a contradiction.)

Now take an open interval neighbourhood $$I=(f(p)- \frac12, f(p)+\frac12)$$ of $$f(p)$$. If $$f$$ were continuous at $$p$$ we'd have an open neighbourhood $$O$$ of $$p$$ such that $$f[O] \subseteq I$$, but then, for each $$n \in N(O)$$, $$n = f(x_n) \in I$$ and so $$I$$ contains infinitely many integers but is only of length $$1$$, which is absurd.

So we've found a point of non-continuity of $$f$$.