Let $f: \mathbb{Z} \rightarrow \mathbb{Z}$ be defined by, for all $n \in \mathbb{N}$

$$f(n)=$$ $$ \begin{cases} n-1 & \text{if n is even}\\ n+5 & \text{if n is odd} \end{cases}$$

Prove that ran $f = \mathbb{Z}$

Is it not enough to simply plug in and show using definitions of odd and even? How would you prove this?


Let $m$ be any integer. It is either even or odd. In either case we shall show that $f(n)=m$ for some integer $n$. If $m$ is odd then $f(m+1)=m$ and if $m$ is even then $f(m-5)=m$. Thus we can take $n=m+1$ when $m$ is odd and $n=m-5$ when $m$ is even.

  • $\begingroup$ @Forextrader Is it clear now? $\endgroup$ – Kavi Rama Murthy Feb 25 at 23:42
  • $\begingroup$ Thus showing the range $f = \mathbb{Z}$ makes perfect sense. $\endgroup$ – Forextrader Feb 25 at 23:43
  • $\begingroup$ Absolutely. Thank you very much $\endgroup$ – Forextrader Feb 25 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.