This is another exercise from Charles Chapman book, Real Mathematical Analysis, that I haven't been able to solve:
To find a bijection between the intervals [a,b], [a,b) and (a,b).
While you can't "write them down", it's not hard to tell you how to form such a bijection. Of course, they can't be continuous functions so don't expect to be able to write them as a simple "formula".
For the [a, b] to [a, b) for example, map all irrationals in a, b (except a and b themselves if they happen to be irrational) to themselves. Now write all the rational rational numbers in the interval in an ordered list (of course, rationals are countable so that can be done) starting with b first and a second (even if a and b are irrational). Map each $\displaystyle x_n$ in that list to to $\displaystyle x_{n+1}$
We will biject $\displaystyle \left[ {0,1} \right] \leftrightarrow \left( {0,1} \right)$ by the following:
$\displaystyle f(0)=\frac{1}{2}~\&~f(1)=\frac{1}{3}$.
If $\displaystyle x=\frac{1}{n}$ for some $\displaystyle n\ge 2$, $\displaystyle f(x)=\frac{1}{n+1}$, otherwise, $\displaystyle f(x)=x$
Now define $\displaystyle g(x)=(b-a)x+a$ as a linear function, $\displaystyle g$ it is a bijection.
So $\displaystyle \left[ {0,1} \right] \leftrightarrow \left[ {a,b} \right]$
Can you show that $\displaystyle g \circ f \circ g^{ - 1} :\left[ {a,b} \right] \leftrightarrow \left( {a,b} \right)$.