I have been trying to construct a bijection from $[0,1)$ to $(0,1)$ that my professor was showing me in class. I think that the function works in terms of being one-to-one and onto. Here's the function
$$f(x)=\Bigl(\dfrac{2^{n+1}-3}{2^n}\Bigr)-x$$
but in order for this function to work (i.e. be 1-1 and onto), we have to have $$x<\dfrac{2^{n}-1}{2^{n}}$$
This is what the graph looks like.
My question is whether or not there a better way to construct $f$ so that $x$ doesn't depend on values of $n$.