Constructing a function using the Schroeder-Bernstein Theorem I am trying to use the proof of the Schroeder-Bernstein theorem to construct a a bijection between $A = (0, 1)$ and $B = [0, 1]$.
I need two injective functions to do so. 
My initial guess is that the bijective function, $h(x)$, will be a piecewise function. Looking at the proof, I think it's a good idea to trace the ancestry of  different numbers to attempt to construct a function. I'm given a hint suggesting me to trace the ancestry of $\frac{4}{9}$, and doing so, I get:
$\frac{4}{9} = g(x) \rightarrow x = \frac{1}{3}$
$\frac{1}{3} = f(x) \rightarrow x = 0$
$0 = g(x) \rightarrow x = -3$, which is no longer in the interval, so I do not need to trace back any further.
I am really unsure of how this helps me. I have the proof of the theorem, and I see the construction of the bijection say $h(a)$ equals $f(a)$ if $a$ has an oldest ancestor in $A$ or $a$ has no oldest ancestor, and $h(a) = b$ otherwise. I thought maybe finding two points and making a linear function could work, but I have no reason to think that $h(x)$ is linear. Any help is much appreciated.
 A: The usual proof goes like this. Let $S \subseteq A$ be a set such that $$g(B\setminus f(S)) = A \setminus S$$
Such a set exists because of Knaster-Tarski fixed point theorem.
Then define $h : A \to B$ as $$h(x) = \begin{cases}
f(x),  & \text{if $x \in S$} \\
g^{-1}(x), & \text{if $x \in A \setminus S$}
\end{cases}$$
where $g^{-1} : g(B) \to B$ denotes the inverse of $g$ on its image.
In our case the condition for $S \subseteq \langle 0, 1\rangle$ is $$g([0,1] \setminus S) = \langle 0, 1\rangle \setminus S$$
Define $$S = \langle 0, 1\rangle \setminus \bigcup_{n = 1}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}$$
Indeed, we have
\begin{align}
g([0, 1] \setminus S) &= g\left(\{0, 1\} \cup \bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}\right) \\
&= \left\{\frac13, \frac23\right\} \cup \bigcup_{n = 1}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\} \\
&=\bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\} \\
&= \langle 0, 1 \rangle \setminus S
\end{align}
Now we can define $h : A \to B$ as $$h(x) = \begin{cases}
x,  & \text{if $x \in \langle 0, 1\rangle \setminus \bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}$} \\
3x-1, & \text{if $x \in \bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}$}
\end{cases}$$
$h$ is the desired bijection.

To interpret this result in the context of your proof, it suffices to prove that $$A_B = \bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}$$
Indeed, take $g^{n}\left(\frac13\right) \in \bigcup_{n = 0}^\infty \left\{g^n\left(\frac13\right), g^n\left(\frac23\right)\right\}$. We have that $g^{n}\left(\frac13\right) \in g(B)$, namely $$g^{n}\left(\frac13\right) = g\left(g^{n-1}\left(\frac13\right)\right)$$
Furthermore, $g^{n-1}\left(\frac13\right) \in \left[\frac13,\frac23\right] \subseteq f(A) = \langle 0, 1\rangle$, the preimage being $g^{n-1}\left(\frac13\right)$. Again, 
$$g^{n-1}\left(\frac13\right) = g\left(g^{n-2}\left(\frac13\right)\right)$$
We continue this until we arrive at $\frac13 \in g(B)$. We have $$\frac13 = g(0)$$
Here the process stops because $0 \notin f(A) = \langle 0, 1\rangle$.
Similar argument works for $g^{n}\left(\frac23\right)$, the oldest ancestor being $1$.
For the reverse inclusion, let $x \in A_B$. Therefore, $x$ has an oldest ancestor $b_i \in B$. We have that $b_i = g(b)$ for some $b \in B \setminus f(A) = [0,1] \setminus \langle 0, 1\rangle = \{0, 1\}$. Therefore, $b_i \in \left\{\frac13, \frac23\right\}$ so it must be that $x = g^n\left(\frac13\right)$ or $x = g^n\left(\frac23\right)$ for some $n \in \mathbb{N_0}$.
