TITLE: show that: $f$ is injective $\iff$ there exists a $g: Y\rightarrow X$ such that $g \circ f = idX$
QUESTION [8 upvotes]: ** proof under construction - will post when done and more or less confident it's true.
** also please easy with the downgrades.. i don't understand why i'm getting them.

what is meant by show that? 
am i supposed to give an example? sure g(y) can be y/2 if f is x*2. 
am i supposed to give a proof ? (we are learning the axioms and the lemmas.) in which case sure, again, given the sets A, B, X, Y and g: Y -> X, and f an injective function defined f: A->B with A a subset of X and B a subset of Y. 
we know that f will map only specific values of X to specific values of Y, i then define f(x) = x*2 and g(y) = y/2 thus g o f = idX is valid.
(i am not sure if this counts as a correct proof, but i am trying) 
I can explain it verbally. I understand the concept. but i have NO idea what the question wants from me. "show that" is too vague.

REPLY [6 votes]: $\newcommand{\Ident}{\operatorname{id}}$For posterity, trying to make this as conceptual and human-friendly as possible (at some expense of brevity).
Let $X$ and $Y$ be non-empty sets and let $f:X \to Y$ be a mapping.
If $x_{1}$ and $x_{2}$ are distinct elements of $X$, let's say ``$f$ identifies $x_{1}$ and $x_{2}$'' if $f(x_{1}) = f(x_{2})$. By definition, $f$ is injective if $f$ does not identify any pair of (distinct) points.
Further, say the effect of $f$ on $X$ can be undone if there exists a mapping $g:Y \to X$ such that $g \circ f = \Ident_{X}$, i.e., $(g \circ f)(x) = x$ for all $x$ in $X$. (Such a $g$ is called a left inverse of $f$.)
To say a function does not identify any pair of points is to say ``$f$ loses no information'', in the sense that an input of $f$ can be recovered uniquely from the corresponding output: If $f(x_{1}) = y = f(x_{2})$, then $x_{1} = x_{2}$.
In this terminology, the goal is to prove that the effect of $f$ on $X$ can be undone if and only if $f$ does not identify any pair of points.
Note that:

If $f$ identifies $x_{1}$ and $x_{2}$, and if $g:Y \to Z$ is an arbitrary mapping, then $g \circ f:X \to Z$ also identifies $x_{1}$ and $x_{2}$. That is, if $f$ is not injective, then for every map $g$ with domain $Y$, $g \circ f$ is not injective. Contrapositively, if $g \circ f$ is injective, then $f$ is injective.
If $f$ is injective and if $y$ is an element of $Y$, then $y = f(x)$ for at most one $x$ in $X$.


(Left-invertible implies injective) If there exists a map $g:Y \to X$ such that $g \circ f = \Ident_{X}$, then $f$ is injective by Observation 1 (since $\Ident_{X}$ is obviously injective).
(Injective implies left-invertible) Suppose $f$ does not identify any pair of points. Fix an element $x_{0}$ of $X$ arbitrarily, and define a mapping $g:Y \to X$ as follows:

If $y$ is in the image of $f$, i.e., if $y = f(x)$ for some $x$ in $X$ (hence for exactly one $x$ by Observation 2), define $g(y) = x$.
If $y$ is not in the image of $f$, then define $g(y) =  x_{0}$.

Clearly $(g \circ f)(x) = x$ for all $x$ in $X$, i.e., $g \circ f = \Ident_{X}$.