Does there exist continous function $f(x)$ such that $$f(x)=\begin{cases} \frac{m}{n} & \text{if } x \text{ is irrational,} \\ \text{irrational} & \text{if } x \text{ is rational} \end{cases}$$ I think it's impossible, as definition of that function is similar to Dirichlet Function or Thomae's function. And these functions are always discontinous somewhere. Please help, I don't know what to start with. I'm first year undergraduate
Does there exist continous function $f(x)$ defined on $(-\infty ; +\infty)$?
3
$\begingroup$
calculus
functions
continuity
-
0So you want a *continuous* function which sends rationals to irrationals and vice versa? – 2017-01-30
-
2What do you denote with $m/n$ ? – 2017-01-30
-
0yes, I do. Sorry for my formulas. I started to learn LaTEX recently – 2017-01-30
-
0$\frac{m}{n}$ is rational number – 2017-01-30
-
0Note the proper use of \text{} in MathJax, as seen in my edit. – 2017-01-30
2 Answers
3
No, there is no such function.
FIrst, $f$ cannot be constant, so by the intermediate value theorem, there exists an interval $[a,b]$ such that $[a,b] \subset f(\Bbb R)$ ($a < b$)
So we have $[a,b] \cap (\Bbb{R}-\Bbb{Q}) \subset f( \Bbb{Q} )$
But $\Bbb{Q}$ is countable, so $f( \Bbb{Q} )$ is countable (or finite) too. In the other hand, $[a,b] \cap (\Bbb{R}-\Bbb{Q})$ is uncountable : contradiction
0
Let $a$ be a rational number and take a sequence $x_n\rightarrow a$ with each $x_n$ irrational. By definition $\lim_{n\rightarrow \infty}f(x_n)=f(a)$. But then $\lim_{n\rightarrow \infty}f(x_n)=\frac{m}{n}=f(a)$, which is impossible.