#### [SOLVED] No continuous function switches $\mathbb{Q}$ and the irrationals

By user10

Is there a way to prove the following result using connectedness?

Result:

Let $J=\mathbb{R} \setminus \mathbb{Q}$ denote the set of irrational numbers. There is no continuous map $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $f(\mathbb{Q}) \subseteq J$ and $f(J) \subseteq \mathbb{Q}$.

http://planetmath.org/encyclopedia/ThereIsNoContinuousFunctionThatSwitchesTheRationalNumbersWithTheIrrationalNumbers.html

#### @Seirios 2013-07-23 13:20:17

Another simple proof:

Because $f$ is continuous and by connectedness, $f([0,1])=[a,b]$ for some $a<b$. Now define $$g : x \mapsto \frac{1}{p} \left(f(x)-q \right), \ \text{where} \ p,q \in \mathbb{Q}.$$

In particular, $g(x)$ is rational iff $f(x)$ is rational, i.e. $g$ has the same property that $f$.

Notice that $g([0,1])= \left[ \frac{a-q}{p}, \frac{b-q}{p} \right]$. Therefore, if $b-1 \leq q \leq a$ and $p \geq b-q$ then $g : [0,1] \to [0,1]$ and classically $g$ has a fixed point $x_0 \in [0,1]$.

Finally we deduce that $x_0 \in \mathbb{Q}$ iff $x_0 = g(x_0) \notin \mathbb{Q}$, a contradiction.

#### @Jonas Meyer 2013-07-23 15:10:28

This uses compactness as well as connectedness of $[0,1]$ to conclude that $f([0,1])$ is a closed, bounded interval.

Very nice proof.

#### @Seirios 2015-08-12 05:49:12

If $f([0,1])=[-1,1]$, then you are suggesting to consider $g(x)=f(x)$ in order to find a function $[0,1] \to [0,1]$, so it doesn't seem to work.

#### @user 170039 2015-08-13 13:48:51

Yes, you are right. Define $g(x)=\left\lvert\dfrac{f(x)}{\left\lceil \max(\left\lvert a \right\rvert,\left\lvert b\right\rvert)\right\rceil}\right\rvert$. I think that it will work.

#### @Seirios 2015-08-14 06:46:04

I think so. But now, your solution does not seem to be really simpler than the original.

#### @leo 2011-08-04 19:30:49

Suppose there is such a mapping $f$. Consider $g:[0,1]\to \mathbb{R}$ defined by $$g(x)=f(x)-x.$$ Suppose that $g(x)\in \mathbb{Q}$ for some $x\in [0,1]$. Then:

• if $x\in J$, then $g(x)-f(x)\in \mathbb{Q}$, i.e. $x\in \mathbb{Q}$.
• if $x\in \mathbb{Q}$, then $g(x)+x\in \mathbb{Q}$, i.e. $f(x)\in \mathbb{Q}$, i.e. $x\in J$

both produce contradictions. Thus $g([0,1])\subseteq J$. Since $f$ is continuous, $g$ is continuous, and then $g([0,1])=[\min g,\max g]$. If $g$ is not constant then there exists $r$ a rational in $[\min g,\max g]$. By the intermediate value theorem, there exists $z\in[0,1]$ such that $g(z)=r$, but this is impossible because $g([0,1])\subseteq J$. Therefore, $g$ must be constant and then $$f(x)=c+x$$ with $c\in J$. Particularly, $f(c)=2c$ which, as Jonas pointed, is contradictory to the hypothesis. Therefore $f$ can not exist.

#### @Jonas Meyer 2011-08-04 19:43:55

A quicker way to finish once you have $f(x)=c+x$ is to note that $f(c)=2c$ is irrational, contradicting the hypothesis. +1: This is a nice alternative that can handle a more general situation. Note that cardinality need not be considered, and in fact $\mathbb Q$ can be replaced by any subgroup of $\mathbb R$.

#### @leo 2011-08-04 19:48:44

yes, that's true and thank you @Jonas, I will correct for the sake of simplicity.

#### @Jonas Meyer 2011-08-04 20:06:40

To clarify my previous comment, I should have said that this argument applies verbatim if $\mathbb Q$ is replaced by any dense subgroup of $\mathbb R$ containing $2$. The last restriction could be handled by rescaling if necessary.

#### @leo 2011-08-04 20:39:29

Yes, I had some doubts after I wrote my comment.

Hey Leo, how do you conclude that $g([0,1]) \subset$\mathbb{I}$from the two contradictions above? #### @leo 2016-07-08 15:56:31 @Kamil what's proveen is that if a point in$g([0,1])$is rational then there are contradictions. So no point in$g([0,1])$can be rational. Real numbers are either rational or irrational, therefore all points in the image of$g$are irrational. #### @Jonas Meyer 2011-08-04 18:22:51 Here's a way to use connectedness, really amounting to using the intermediate value theorem. If$f(\mathbb{Q})\subseteq \mathbb R\setminus\mathbb Q$and$f(\mathbb R\setminus \mathbb Q)\subseteq\mathbb Q$, then$f(0)\neq f(\sqrt 2)$. Because intervals are connected in$\mathbb R$and$f$is continuous,$f[0,\sqrt 2]$is connected. Because connected subsets of$\mathbb R$are intervals,$f[0,\sqrt 2]$contains the interval$\left[\min\{f(0),f(\sqrt 2)\},\max\{f(0),f(\sqrt 2)\}\right]$. The set of irrational numbers in this interval is uncountable, yet contained in the countable set$f(\mathbb Q)$, a contradiction. A slightly briefer outline: The hypothesis implies that$f$is nonconstant with range contained in the countable set$\mathbb Q\cup f(\mathbb Q)$, whereas the intermediate value theorem and uncountability of$\mathbb R$imply that a nonconstant continuous function$f:\mathbb R\to\mathbb R$has uncountable range. #### @user10 2011-08-04 18:31:43 thank you, beautiful argument. #### @GEdgar 2011-08-04 18:52:21 More elementary than a proof using Baire Category! #### @Hagen von Eitzen 2013-12-29 23:13:13 I like the second paragraph version #### @spaceman_spiff 2017-03-22 09:23:09 @Jonas Meyer How to prove rigoruosly that$f(\mathbb{Q})$is countable...a hint would do...I have to do this as a homework question ...i have understood the general idea but unable to express rigoruously the above cardinality argument..thanks #### @Jonas Meyer 2017-03-23 01:35:46 @spaceman_spiff: If$A=\{a_1,a_2,a_3,\ldots\}$is a countable set and$f$is a function defined on$A$, then$f(A)=\{f(a_1),f(a_2),f(a_3),\ldots\}$is a countable set. ### Related Questions #### Sponsored Content #### 1 Answered Questions ### [SOLVED] There exists a continuous function$f$such that$f(\Bbb Q) \subseteq \Bbb R\setminus\Bbb Q$and$f(\Bbb R\setminus\Bbb Q)\subseteq\Bbb Q$#### 4 Answered Questions ### [SOLVED] Conceptual proof why a continuous surjective function$f: \mathbb R \setminus \mathbb Q \to \mathbb N$can exist #### 1 Answered Questions ### [SOLVED] Every continuous function must be constant? #### 1 Answered Questions ### [SOLVED] Continuous functions and the boundary #### 2 Answered Questions ### [SOLVED] Does there exist a continuous onto function from$\mathbb{R}-\mathbb{Q}$to$\mathbb{Q}\$?

• 2015-09-13 18:04:17
• Shubham Ugare
• 727 View
• 9 Score
• Tags:   real-analysis

### [SOLVED] Continuity of Thomae's Function at Irrationals

• 2014-08-27 09:53:20
• Groups
• 746 View
• 1 Score
• Tags:   real-analysis

### [SOLVED] Establishing the existence of a strictly increasing real function, discontinuous at all rationals and continuous at all irrationals

• 2014-04-26 13:06:40
• user1770201
• 650 View
• 2 Score
• Tags:   real-analysis