# $f:A→B$ is surjective but not injective, so it has a left-inverse, but no right-inverse?

If $f:A→B$ is surjective but not injective, it has a left-inverse, but no right-inverse? It would make sense to me if it were the opposite.

If $f:A→B$ is surjective but not injective, it has a left-inverse, but no right-inverse.

For example let $f: R → [0, ∞)$ denote the squaring map, such that $f(x) = x^2$ for all x in R, and let $g: [0, ∞) → R$ denote the square root map, such that g(x) = √x for all x ≥ 0. Then f(g(x)) = x for all x in $[0, ∞)$; that is, g is a right inverse to f. However, g is not a left inverse to f, since, e.g., $g(f(−1)) = 1 ≠ −1$.

The second answer makes sense to me. But aren't the two statements are saying the negations of each other? So that would make the first answer false?

• As a side note: The inverse only exists if you have some sort of axiom of choice – Jürg Merlin Spaak Oct 17 '17 at 6:55

If $f:A\to B$ is surjective, then we can compose it with a $g:B\to A$ to get $B\overset g{\to} A\overset f\to B$ which becomes the identity on $B$. In this case, $g$ is put on the left of $f$ (technically, the existence of $g$ does require the axiom of choice in the general case, but let's not get into that).
However, if we write things algebraically, we denote this function as $f\circ g$ and its value at $b\in B$ as $f(g(b))$, which puts $g$ to the right of $f$.
I believe this is the confusion that gives the two seemingly conflicting answers. For completeness, it is the latter which is the conventional way of writing it, which means that if $f$ is surjective, but not injective, then it does have a right inverse, but not a left inverse.
After reading the first answer, I can also see that he puts the composition in the wrong order (i.e. he writes $f\circ g$ for the function that first uses $f$, then applies $g$ to the result), so this is clearly what has happened.
• @bof If I happen to get magically sent back a few centuries and get the oppurtunity to reboot modern mathematics, putting functions to the right of their argument is one of the things I would do (yes, I have a list), which would indeed mean that $f\circ g$ becomes "apply first $f$ then $g$". – Arthur Oct 17 '17 at 7:39