Bijection from (0,1) to [0,1)

I'm trying to solve the following question:

Let $f:(0,1)\to [0,1)$ and $g:[0,1)\to (0,1)$ be maps defined as

$f(x)=x$ and $g(x)=\frac{x+1}{2}$. Use these maps to build a bijection $h:(0,1)\to [0,1)$

I've already proved that these maps are injectives, and following the others questions on the site such as

Continuous bijection from $(0,1)$ to $[0,1]$

How to define a bijection between $(0,1)$ and $(0,1]$?

I think I can found such $h$, but the problem is that we have to use only $f$ and $g$ to build $h$.

I need help.

Thanks a lot.


Solution 1:

If $x$ has shape $1-\frac{1}{2^n}$, where $n$ is a non-negative integer, let $H(x)=g(x)$. Otherwise, let $H(x)=f(x)$.

This gives a bijection in the "wrong" direction. Take the inverse.

Solution 2:

The slick answer is

Since each of $f$ and $g$ are clearly injective, apply the Cantor-Bernstein theorem to $f$ and $g$. This gives a bijection $(0,1)\to[0,1)$.

It may be implicit in the question that you're supposed to "crank the handle" on the proof of Cantor-Bernstein in order to find an explicit description of the particular bijection it produces. In that case you'd start by finding the ranges (not merely the domain) of $f$ and $g$, namely $(0,1)$ and $[\frac12,1)$.

What happens next depends on the details of the proof of Cantor-Bernstein you're working with, but in one that is easiest to apply here, we look for the the part of $[0,1)$ that is not in the range of $f$, which is the singleton $\{0\}$. If we iterate $f\circ g$ on this, we get $A=\{1-2^{-n}\mid n\in \mathbb N\}$. Then the bijection $H:[0,1)\to(0,1)$ is $$ H(x) = \begin{cases} g(x) & x\in A \\ f^{-1}(x) & x\notin A \end{cases} $$ Now unfold this definition and invert it to get $h$.