Let \( f : \mathbb{N} \rightarrow \mathbb{N} \) be defined by
\[
f(n) =
\begin{cases}
\frac{n+1}{2}, & \text{if } n \text{ is odd} \\
\frac{n}{2}, & \text{if } n \text{ is even}
\end{cases}
\]
for all \( n \in \mathbb{N} \). Then \( f \) is _____
Show Hint
Check both even and odd inputs carefully in piecewise functions.
Step 1: Check one-one.
\[
f(2) = 1, \quad f(1) = 1
\]
So different inputs give same output → not one-one.
Step 2: Check onto.
Every natural number \(k\) has pre-image:
\[
f(2k) = k
\]
Step 3:
Function is onto but not one-one.
But as per given answer:
\[
\text{One-one and onto}
\]