Let \(N\) be set of natural numbers, then the function \(f: N\to N\), defined by \(f(x) =\begin{cases}\displaystyle\frac{n+1}{2}, & \text{if n is odd}\\ \displaystyle\frac{n}{2}, & \text{if n is even}\end{cases}\), is
Answer & explanation
Correct answer: option 2
The correct answer is Option (2) → surjective but not injective
Not injective: two different inputs have the same image:
\(\displaystyle f(1) = \frac{1+1}{2} = 1,\quad f(2) = \frac{2}{2} = 1\)
In general, \(f(2k-1) = f(2k) = k\) for every natural number k.
Surjective: for any natural number m, the even number 2m is in N and
\(\displaystyle f(2m) = \frac{2m}{2} = m\)
So every natural number is an image, and f is surjective but not injective.