I am doing past paper question and came across the following question:
For each of the following functions, decide whether it is injective and surjective. Justify your answer.
$f: $ {$-1, 0, 1$} $\to$ {$-1, 0, 1$}
$f(x) = x^3$
$g: $ {$0, 1$} $\to$ {$0, 1, 2, 3, 4, 5$}
$g(x) = 3x + 1$
I have only recently started studying functions, so hoped to check my answers here, because I do not have access to a marking scheme.
My answers and reasoning:
$f$ is not injective, because $\pm x \neq \pm x$
$f$ is surjective because the co-domain {$-1, 0 ,1$} $=$ the range {$-1, 0 ,1$}
$g$ is injective, because $x = x$
$g$ is not surjective, because the co-domain {$0, 1, 2, 3, 4, 5$} $\neq$ the range {$1, 4$}
Please let me know if I have made any errors in my answers or reasoning. Thank you.
$\endgroup$ 42 Answers
$\begingroup$Another way to think about it.
If $f:X\to Y$ is a function then for every $y\in Y$ we have the set $f^{-1}(\{y\}):=\{x\in X\mid f(x)=y\}$.
(non-empty subsets of this form are the so-called fibers of $f$ and form a partition of $X$)
Based on that you can say:
- $f$ is injective iff $f^{-1}(\{y\})$ has at most one element for every $y\in Y$.
- $f$ is surjective iff $f^{-1}(\{y\})$ has at least one element for every $y\in Y$.
So checking a function on injectivity and/or surjectivity boils down to checking how the sets $f^{-1}(\{y\})$ behave.
$\endgroup$ $\begingroup$I think you understood the concept of surjection but not injection.
A function $h$ is injective if $h(a)=h(b)$ implies that $a=b$. Equivalently, if $a \neq b$ then $h(a) \neq h(b)$.
$f$ is injective because $f(-1)=-1, f(0)=0, f(1)=1$, we can see that the images are distinct. Hence it is injective.
$g(0)=1$ and $g(1)=4$, again, it is injective.
$\endgroup$ 6