Evaluating the statement an "An injective (but not surjective) function must have a left inverse" I'm having a difficulty trying to understand the statement "An injective (but not surjective) function must have a left inverse" and how it works. I've tried breaking the statement down step by step using diagrams in order to see how it works and in order to keep the post short.

About step 1:
Here $f$ is an injective only function (one-to-one & into) and $g$ is a surjective only function (multi-to-one & onto). 
About step 2:
When $f$ maps $1,2\in X$, it outputs $r,s\in Y$ as the image. And the image of $f$ becomes the domain of $g$ in the composition. Which makes  $t\in Y$ not mapped by $g$ in this case. It was easy to find a function which can invert $f$ back to the exact same members of $X$.
About step 3:
The composition $g\circ f$ is a bijective function
My questions are: 
1)  In my comments of step 2 “And the image of $f$ becomes the domain of $g$ in the composition”. Is this statement correct?
2)  In step 2, $t\in Y$ is not mapped by $g$ since it was not a member of the image of $f$. So doesn’t that makes $g$ a partial function in this case, since it doesn’t map all the members of its own domain ($Y$) ? Also another note is $t\in Y$ doesn’t have any element from $X$ who maps (relates) to it via $f$. Is there any reference which explicitly explain how to handle such $t\in Y$ like in the above function composition?
3)  I have read somewhere that in order for the composition to give a valid (properly defined) result, “the image” of $f$ (in the example above) must be at least a “subset” of the “domain” of $g$ (which is $Y$ in the example above). But does that mean that the “codomain” of $f$ doesn’t have to be the same as the “domain” of $g$ for the function composition ($g\circ f$) to work aka validly defined? In the example above, Supposed that the codomain of $f$ is now $Z=(r, s, w)$ or $W=(r, s)$ and not $(r, s, t)$ but the image of $f$ remains the same $(r,s)$ and the domain of $g$ also remains the same $(r,s, t)$. What would happen to the composition? Will it still be valid & why?
 A: I'm not sure what you mean by “injective-only”. Anyway, what you want is, given $f\colon A\to B$ that is injective, a map $g\colon B\to A$ such that $g\circ f$ is the identity on $A$ that is, for all $a\in A$, $g(f(a))=a$.
First let me add the assumption that $A$ is not empty (otherwise the result is false). Let $a_0\in A$. Which one? It's irrelevant.
Now, how do you define a map $g\colon B\to A$?
Let's look at step 1 in your picture. If $b\in B$, there are two cases:


*

*$b=f(a)$, for some $a\in A$ (example: $s=f(2)$)

*$b\ne f(a)$, for all $a\in A$ (example $t$)


In the first case, define
$$
g(b)=a
$$
which is justified because there is a unique $a\in A$ such that $b=f(a)$, by injectivity.
In the second case, define $g(b)=a_0$.
Thus we have a map $g\colon B\to A$. If $a\in A$, then
$$
g(f(a))=a
$$
by definition of $g$, so $g$ is really the sought left inverse of $f$.

The point about $a_0$ sometimes confuses beginners (just like those pictures do, actually). There is no special role about $a_0$; it is needed in order to define $g$ also on elements “not reached by $f$”. One might define $g$ on these elements by saying “pick an element of $A$ at random”, but this would be much more difficult to formalize. We are looking for one left inverse, not for all of them.
