[Math] Does there exist a continuous onto function from $\mathbb{R}-\mathbb{Q}$ to $\mathbb{Q}$

real-analysis

Does there exist a continuous onto function from $\mathbb{R}-\mathbb{Q}$ to $\mathbb{Q}$?
(where domain is all irrational numbers)

I found many answers for contradicting the fact that there doesnt exist a continuous function which maps rationals to irrationals and vice versa.

But proving that thing was easier since our domain of definition of function was a connected set, we could use that connectedness or we could use the fact that rationals are countable and irrationals are uncountable.

But in this case those properties are not useful. I somehow think that baire category theorem might be useful but I am not good at using it.

Best Answer

Yes. Say $E_n$ is the set of irrationals in the interval $(n,n+1)$. Say $(q_n)$ is an enumeration of $\Bbb Q$. Define $f(x)=q_n$ for $x\in E_n$.

Related Question