another proof of the non-existence of a continuous function that switches the rational and the irrational numbers
Let denote the irrationals.There is no continuous function such that and .
Proof
Suppose is such a function. Since is countable, and are also countable. Therefore the image of is countable. If is not a constant function, then by the intermediate value theorem the image of contains a nonempty interval, so the image of is uncountable. We have just shown that this isn’t the case, so there must be some such that for all . Therefore and . Obviously no number is both rational and irrational, so no such exists.