Let $f: \mathbf{N} \rightarrow \mathbf{N}$ be defined by $f(n)=\left\{\begin{array}{ll}\frac{n+1}{2}, & \text { if } n \text { is odd } \\ \frac{n}{2}, & \text { if } n \text { is even }\end{array}\right.$ for all $n \in \mathbf{N}$.
State whether the function f is bijective. Justify your answer.
$f: \mathbf{N} \rightarrow \mathbf{N}$ is defined as $f(n)=\left\{\begin{array}{ll}\frac{n+1}{2}, & \text { if } n \text { is odd } \\ \frac{n}{2}, & \text { if } n \text { is even }\end{array}\right.$ for all $n \in \mathbf{N} .$
It can be observed that:
$f(1)=\frac{1+1}{2}=1$ and $f(2)=\frac{2}{2}=1 \quad$ [By definition of $\left.f\right]$
$\therefore f(1)=f(2)$, where $1 \neq 2$
∴ f is not one-one.
Consider a natural number (n) in co-domain N.
Case I: n is odd
$\therefore n=2 r+1$ for some $r \in \mathbf{N}$. Then, there exists $4 r+1 \in \mathbf{N}$ such that
$f(4 r+1)=\frac{4 r+1+1}{2}=2 r+1 .$
Case II: n is even
$\therefore n=2 r$ for some $r \in \mathbf{N}$. Then,there exists $4 r \in \mathbf{N}$ such that $f(4 r)=\frac{4 r}{2}=2 r$.
∴ f is onto.
Hence, f is not a bijective function.