Math Help - Please help me to prove f is surjective iff f has a right inverse.

Prove: f is surjective iff f has a right inverse.

f is surjective if for all b in B there is some a in A such that f(a) = b.
f has a right inverse if there is a function h: B ---> A such that f(h(b)) = b for every b in B.

i. Suppose f has a right inverse h: B --> A such that f(h(b)) = b for every b in B. Then for each b in B, let a in A such that f(a) = b. Let h(b) = a, then f(h(b)) = f(a) = b. Thus f is surjective.

ii. Suppose f is surjective. That is, for every b in B, there is some a in A such that f(a) = b. How to show that f has a right inverse? Please help. Thank you.

2. Let $f: S \to T$ be a surjection.

then $\forall y \in T: f^{-1} \{y\} \ne \varnothing$

Let $f^{-1} \{y\} = X_y = \{x_{y_1}, x_{y_2}, ...\}$

Using the Axiom of Choice, for each $y \in T$ we can choose any of the elements $x_{y_1}, x_{y_2}, \ldots$ to be identified as $x_y$, and thereby define:

$g: T \to S: g (y) = x_y$

Then we see that $f \circ g (y) = f (x_y) = y$

and thus $f \circ g = I_T$.

3. Is $f^{-1} \{y\}$ the same as $f^{-1}(y)$?

4. Excellent question.

We know that f is a surjection, but f is not necessarily bijective, thus there could be more than one element of S mapped to one element of T. Thus the inverse of f is not necessarily a mapping, as an element of T does not necessarily map to a single element of S.

So technically speaking you can not talk about the inverse element of y, but you can talk about the set of elements of S that the inverse of f relates to.

What I mean by $f^{-1}\{y\}$ is actually the preimage of $f$, and in this context I find that considering y as a set (admittedly a singleton one) rather than an element enhances the understanding of what's going on.