Let $A$ and $B$ bet sets such that $A \subseteq B$. If there is an injective function $f: B \rightarrow A$, then there is a bijective function $h:B \rightarrow A$.
I understand how to prove this except up to a certain point. We define a subset $E$ of $B$ and a function $h$ such that $h=f$ on $E$ and $h=\text{ identity }$ elsewhere. So the function is as follows: $h(x) = \begin{cases} f(x)&\mathrm{\ if\ }x\in E\\ x&\mathrm{\ if\ }x\in B\setminus E. \end{cases}$ There are also these following facts: (i) $f(E)\subseteq E$ amd (ii) $B\setminus E \subseteq B \setminus E_0 = A$.
There is a sequence of sets $E_{n+1}=f(E_n)$ for all n=0, 1, 2, 3, 4,...etc. Furthermore $E = \cup E_n$. I'm not sure if the immediately previous sentence is necessary as I was informed only the two enumerated facts were required.
My understanding of the problem is as follows. By how we defined $h$ we get that it is injective for free since it behaves like an injective function on $E$ and the identity function elsewhere. The only part I am stuck on is how to prove that $h(x)$ is onto. Specifically with regards to $h(x)$ when its on $E$.