I am trying to prove Schröder–Bernstein theorem myself but I am stuck. Here is my try.
Let $f:A \rightarrow B$ and $g:B \rightarrow A$ be injective functions for sets $A$ and $B$. Define $h: A \rightarrow B$ as follows:
$$ h\left(x\right) = \begin{cases} f(x) & \nexists b : g(b)=x \\ g^{-1}(x) & \text{otherwise} \end{cases} $$
$h$ is a well defined function because $g$ is injective and it is onto as well.
I am stuck at this point because $h$ can be surjective. However for each $x \in B$, there can be at most $2$ distinct elements of $A$ which map to $x$. I think this observation can be used to make use of an argument similar to Hilbert's paradox but I am not able to come up with it.
I don't need a complete solution, a hint in the right direction would be much appreciated.