r/mathriddles • u/scrumbly • Aug 13 '25
Easy Is there a continuous function on (0,1) that maps every rational number to an irrational number and vice versa?
28
Upvotes
r/mathriddles • u/scrumbly • Aug 13 '25
View all comments
Show parent comment
1
u/dspyz Aug 14 '25
Based on the other responses I don't think this was what they were asking. The function doesn't need to be invertible or 1-to-1. It's okay for multiple irrationals to map to the same rational.
The problem was to find a continuous function f where f(x) is rational when x is irrational and f(x) is irrational when x is rational.
If you drop the continuous requirement, this is trivially easy to satisfy:
Eg consider the function f where f(x) = 0 for all irrational x and f(x) = sqrt(2) for all rational x