# Bijective function

Recently I was wondering if we need the Axiom of Choice in order to find an inverse function given an bijective funcion: If $f:A \rightarrow B$ is bijective we mean that $f$ is injective and surjective. Assume that $f:A \rightarrow B$ is bijective. I want to define $f^{-1}: B \rightarrow A$ s.t. $f \circ f^{-1} = 1_B$ and $f^{-1} \circ f = 1_A$. For each $b \in B$ let $X_b := \{x \in X: f(x) = b \}$. By surjectivity each $X_b$ is non-empty. But not knowing wether $A$ or $B$ are finite I need AC in order to select from each $X_b$ an (in fact unique) element $x_b$ and defining $f^{-1}(b) := x_b$ for each $b \in B$.

Is AC necassary ?

AC is not necessary at all. Since $f$ is bijective, you should be able to show that $X_b$ has exactly one element for all $b\in B$. (If any $X_b$ had more than one element, what could we conclude about $f$? If any $X_b$ were empty, what could we conclude about $f$?) Then we can define $f^{-1}:B\to A$ by letting $f^{-1}(b)$ be the unique element of $X_b$. That will do the trick.
Now, suppose that you were instead given a surjective function $f:A\to B$ with $f$ not necessarily injective, and that you wanted a function $g:B\to A$ such that $f\circ g$ is the identity function on $B.$ In that case, we would in fact require Choice to conclude that such a function exists, unless you had some way of knowing that there were only finitely-many distinct $X_b$ (say if $B$ were finite) or at least that $B$ is well-orderable (which provides a convenient way to pick an element from each $X_b$, even if there are infinitely-many of them).
In fact, even if we know that the $X_b$ are finite, we need some Choice. It is consistent with $\mathsf{ZF}$ that there is a function $f:A\to B$ such that each $X_b$ has exactly two elements, but such that there is no function $g:B\to A$ such that $f\circ g$ is the identity function on $B$.
• Is $AC$ then only necassary if we would not know that the $X_b$ are finite? ( In a general case )