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 have been attempting to do the following question by contradiction. However, I just got stuck at where to use the given continuity condition. It would be really appreciated if you can possibly give a further hint to solving this problem.

Here it goes

Let $f(x):\mathbb{R} \rightarrow \mathbb{Q}$ is a continuous function. Prove that $f$ is a constant.

share|cite|improve this question
Can you find a real number between two given rationals? – Pedro Tamaroff May 5 '12 at 0:18
More to the point, can you find an irrational number between two rationals? – Robert Israel May 5 '12 at 0:31
Yes, it was my initial idea of using Density Theorem. However, I do not see the connection between that with the function. – Viet Hoang Quoc May 5 '12 at 0:42
Look at this – leo May 5 '12 at 0:49

The basic idea behind this problem is the following statement:

Theorem: The continuous image of a connected space is connected.

Now, $\mathbb{R}$ is connected--that is just a fact. Now, $\mathbb{Q}$ is not connected (in fact, it's totally disconnected) since given any irrational number $\xi$ one has that $\mathbb{Q}=[(-\infty,\xi)\cap\mathbb{Q}]\cup[(\xi,\infty)\cap\mathbb{Q}]$ is a disconnection.

share|cite|improve this answer
Great solution, however, the question requires the answer to use the definition of the continuity. Thereby, I just do not know where to start. – Viet Hoang Quoc May 5 '12 at 0:39
@VietHoangQuoc Well, which definition of continuity are you using? – Alex Youcis May 5 '12 at 0:41
The formal one as follows For all $ \epsilon >0$, there exists $ \delta >0$ such that for all $ x \in \mathbb{R}$ satisfying $ |x-x_0| < \delta$, one has $ |f(x)-f(x_0)| < \epsilon $. – Viet Hoang Quoc May 5 '12 at 0:43
@VietHoangQuoc Ditch that definition here. Use the following definition: A function $f: X \rightarrow Y$ between two topological spaces is continuous if for every open set $U$ in $Y$, the preimage of $U$ under $f$ is open in $X$. – user38268 May 5 '12 at 0:46
Here is another similar type of question proving the function is constant using the continuity definition, Let $f: [-1,1] \to \mathbb{R}$ be a function with $f(x)=f(x^2)$ for all $ x \in (-1,1)$. Suppose that $f$ is continuous at 0. Prove that $f$ is a constant. – Viet Hoang Quoc May 5 '12 at 1:03

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.