Does there exist continous function $f(x)$ defined on $(-\infty ; +\infty)$? 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

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
