TITLE: Elementary Set Theory Question
QUESTION [6 upvotes]: I am working on the following question.

Let $X$ be a nonempty set and consider a map $f:X\to Y$. Prove that the following are equivalent:
(a) $f$ is injective;
(b) there exists $g:Y\to X$ such that $g∘f=1_{X}$ where $1_{X}:X\to X$ is the identity map;
(c) for any set $Z$ and any maps $h_{1},h_{2}:Z\to X$, the equation $f∘h_{1}=f∘h_{2}$ implies that $h_{1}=h_{2}$.
(*I would like to add here that the "$1$" from each "$1_{X}$" is supposed to be written with the Math Blackboard font - I'm not sure how to do that*)

My issue at the moment arises from being unable to understand (some of) the notation and ideas. I will attempt to describe in my own terms what I believe to understand. I apologize for the terribly imprecise language. You will see why I am not ready to prove anything yet.
(a) That the function $f$ is injective means that it never maps distinct elements of its domain to the same element of its codomain. So every element from the set $X$ maps to a unique element in the set $Y$. And vice versa. A function of the form $f(x)=ax+c$ would be injective (and also a bijection) while a function of the form $f(x)=ax^{2}+bx+c$ would not be (assuming no restrictions on the domain). 
(b) This part states that there exists a function $g$ that maps the set $Y$ to the set $X$. The rest I am not sure of. The composite function $g∘f$ equals the identity map $1_{X}$. Does the identity map simply map X back onto X? For instance if $X=\left \{ 1,2 \right \}$, does $1_{X}$ map $1 \to 1$ and $2 \to 2$? So this part would mean, informally, that if you take an element from $Y$, replace it with its corresponding element from $X$, and then map it back to the same element from $X$, you get the identity map. Essentially each element from $Y$ maps to one element from $X$ and you can go back and forth between the sets.
(c) Now the final part. There is a set $Z$ and two maps $h_{1}$, and $h_{2}$, both of which map the set $Z$ to the set $X$. Furthermore (and I dont know if this notation is acceptable),
$$f:(h_{1}:Z \to X) \to Y=f:(h_{2}:Z \to X) \to Y.$$
I'm not seeing why this shows that $f$ is injective. 
I apologize again for this clutter. This is my first real exposure to set theory for my first year Calculus course and our textbook (Stewart) does not cover this. Writing this out has actually helped me to get a better grasp of what I am trying to prove, though I doubt it looks that way. Any help would be appreciated.

REPLY [4 votes]: To show that three statements are equivalent one needs to assume the first, show that the second follow; assume the second and show that the third follow; and lastly assume the third and show that the first follow. (Of course one can mix the order up, or show equivalence of pairs instead - very much of the order depends on the formulation of the problem).

If so suppose that $f:X\to Y$ is injective. Let $x_0\in X$ be a fixed element (since $X$ is non-empty we have such element) we can define $g:Y\to X$ as $$g(y)=\begin{cases} f^{-1}(x) & y\in Rng(f)\\ x_0 &\text{otherwise}\end{cases}$$
This is indeed a good definition since $f$ is injective $f^{-1}$ defined on its range. Now consider $g\circ f:X\to X$, it takes $x$ to $g(f(x))$ however $f(x)\in Rng(f)$ so $g(f(x))=f^{-1}(f(x))=x$ as wanted.
Suppose that $f:X\to Y$ is such that $g$ exists as wanted. Let $h_1,h_2$ be maps as specified, and $f\circ h_1=f\circ h_2$. Consider $g\circ (f\circ h_i):Z\to X$ since $\circ$ is associative this is the same as $(g\circ f)\circ h_i$, but by our assumption this is the same as $h_i$. So we have that $h_1=h_2$ as wanted.
Lastly, suppose the third condition, and assume by contradiction that $f$ is not injective. It means that for some $a,b\in X$ we have $f(a)=f(b)$ while $a\neq b$. Define $Z=\{0,1\}$ and $h_1(n)=a$ for all $n\in Z$ while $h_2(n)=b$ for all $n\in Z$. Now we have that $f\circ h_1=f\circ h_2$ but $h_1$ is clearly not equal $h_2$ - contradiction as wanted.

The main trick is indeed in the last implication $(3)\Rightarrow (1)$ but you need to exploit the fact that the assumption is on any space $Z$, and so we are free to generate counterexamples if we want to.