In a recent course on logic, while discussing the Cantor-Bernstein theorem, it was mentioned that the seemingly equivalent theorem, but with "injection" replaced with "surjection" is only true if you assume the axiom of choice. I assumed that this is quite a simple statement, since to construct an injection from a surjection, you may at some point need to choose one element from the pre-image of a singleton, but one can write a "proof" for creating an injection from a surjection that doesn't seem to have one specific step where the axiom of choice is used, here is the proof I am considering
Let $f:A\to B$ be a surjection. Then for every $x$ in $B$ there is some $y$ in $A$ such that $f(y) = x$. Let $x$ be in $B$, and let $y$ be in $A$ such that $f(y)=x$. Then consider the relation
\begin{align} g_x= f^{-1}\backslash (\{x\}\times f^{-1}(\{x\}))\cup\{(x,y)\} \end{align}
And since $x$ was arbitrary, we know such a $g_x$ exists exists for every $x$ and then we can simply intersect all such $g$ and the resulting set is an injection from $B$ to $A$. Clearly somewhere in this proof (possibly more than once) the axiom of choice was used, but since the proof is written in an informal language, the use of this axiom is not explicit, my question is where exactly could we not proceed without the axiom of choice? Do we need the axiom of choice to go from "$\exists_{x\in B}$" such that..." To "let $x\in X$ be such that $...$" and the same for the $y\in A$? Or is this fine to do regardless, since we're only "considering" a set element, and we only need AC to guarantee the existence of the set
$\{g_x \subseteq B\times A| x\in A\}$
That we intersect to find the eventual injection?
In short, I know the formal definition of the axiom of choice, but I struggle to identify which informal arguments, if made formal, would require its use.