Exercise 21.

Consider the function \(f:\Z \to \Z\) given by \(f(n) = \begin{cases}n+1 \amp \text{ if }n\text{ is even} \\ n-3 \amp \text{ if }n\text{ is odd} . \end{cases}\)

  1. Is \(f\) injective? Prove your answer.

  2. Is \(f\) surjective? Prove your answer.

Solution.
in-context