Find a function f that maps two open intervals to each other?

20 Views Asked by At

Let's say I have two disjoint open intervals (a,b) and (c,d). Does there exist a continuous function f that maps (a,b) to (c,d) and (c,d) to (a,b)? For example, if I have (0,1) and (1,2), I can use f(x) = -x+2. Or if I have (3,6) and (12,15), I can use -x+18. I can do something similar as long as the intervals are of equal length, i.e. b-a=d-c. But what if they aren't of equal length? Can I construct a continuous function that sends (a,b) to (c,d) and (c,d) to (a,b)?