First consider the definitions of what it means for a function to be one-to-one or onto (definitions adapted from John Durbin's Modern Algebra):
One-to-one: A mapping $\alpha\colon S\to T$ is said to be one-to-one if $ \alpha(x_1) = \alpha(x_2)\quad\text{implies}\quad x_1=x_2\quad (x_1,x_2\in S), $ that is, if unequal elements in the domain have unequal images in the codomain.
Onto: If $\alpha\colon S\to T$ and $\alpha(S)=T$, then $\alpha$ is said to be onto. Thus $\alpha$ is onto if for each $y\in T$ there is at least one $x\in S$ such that $\alpha(x)=y$.
You can sort of visualize the above definition of onto with the following picture:
$\color{white}{\text{center it no}}$
Example: Let $S=\{x,y,z\}$ and $T=\{1,2,3\}$. Then a mapping $\alpha\colon S\to T$ may be defined by $\alpha(x)=2, \alpha(y)=1, \alpha(z)=3$. Another mapping, $\beta\colon S\to T$, is given by $\beta(x)=1,\beta(y)=3,\beta(z)=1$. The mapping $\alpha\colon S\to T$ looks like this:
$\color{white}{\text{center it now pleas keep goo}}$
And the mapping $\beta\colon S\to T$ looks like this:
$\color{white}{\text{center it now pleas keep goo}}$
For $\alpha\colon S\to T$, we can see this mapping is onto because each element in $T$ is being mapped to by some element in $S$:
- $y\mapsto 1$
- $x\mapsto 2$
- $z\mapsto 3$
But what about $\beta\colon S\to T$? Is this mapping onto? Can you see why not? Consider the following:
- $x\mapsto 1$
- $z\mapsto 1$
- $\color{red}{?\mapsto 2}$
- $y\mapsto 3$
For $\beta\colon S\to T$ to be onto, each element in $T$ must be mapped to by some element in $S$. Unfortunately, as we can see above by the part highlighted in red, no element in $S$ actually maps to $2$ which is in $T$. Thus, $\beta$ is not an onto mapping.
Similar reasoning will show that $\alpha$ is one-to-one but $\beta$ is not. Does it all make sense now?