Pre composition with f Let $X$, $Y$ be sets and let $f:X \to Y$ be a map. 
For any set $T$ and any map $\psi:Y \to T$ from $Y$ to $T$, we may pre-compose $\psi$ with $f$ to get the composite map $\psi \circ f : X \to T$ from $X$ to $T$.
This procedure defines a map $$\Psi_T : Maps(Y,T) \to Maps(X,T),               \psi \mapsto \psi \circ f$$
How do i show that $f:X\to Y$ is surjective if and only if for any set T, the map $\Psi_T$ is injective?  
 A: If $T$ has only one element, then $Maps(Y,T)$ has also only one element and $\Psi_T$ is injective, no matter how $f$ is. In fact, if $T$ has only one element and $Y$ has more than one element, the statement is false. So let's assume that $T$ has more than one element.
If we assume that $f$ is not surjective then there is some $y_0\in Y$ which is not the image of any element of $X$. Take any function $\psi:Y\to T$ and any element $t_1\in T-\{\psi(y_0)\}$ (at this point we need that $T$ has more than one element), and define
$$\phi(y)=\begin{cases}\psi(y)\text{ if }y\neq y_0\\t_1\text{ if }y=y_0\end{cases}$$
Then $\Psi_T(\psi)=\Psi_T(\phi)$ but $\psi\neq \phi$. Thus, if $\Psi_T$ is injective then $f$ is surjective.
Assume now that $f$ is surjective, and let's show that $\Psi_T$ is injective. For that, suppose that $\Psi_T(\psi)=\Psi_T(\phi)$, or, equivalently, $\psi\circ f=\phi\circ f$. Take any $y\in Y$. Since $f$ is surjective, $y=f(x)$ for some $x\in X$. Then $\psi(y)=\psi(f(x))=\phi(f(x))=\phi(y)$. We conclude that $\psi(y)=\phi(y)$ for every $y\in Y$, that is, $\psi=\phi$.
