If the function \(f : N \rightarrow N\) is defined as \(f(n)=\begin{cases}n-1, & \text{if } n \text{ is even}\\ n+1, & \text{if } n \text{ is odd}\end{cases}\), then
(A) f is injective
(B) f is into
(C) f is surjective
(D) f is invertible
Choose the correct answer from the options given below:
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → (A), (C) and (D) only
The function swaps each odd number with the next even number:
\(f(1) = 2,\ f(2) = 1,\ f(3) = 4,\ f(4) = 3,\ \ldots\)
One-one: let f(m) = f(n).
m, n both even: \(m - 1 = n - 1\), so \(m = n\)
m, n both odd: \(m + 1 = n + 1\), so \(m = n\)
m even, n odd: f(m) = m − 1 is odd and f(n) = n + 1 is even, so they cannot be equal
Onto: take any k in N.
k odd: k + 1 is even and \(f(k + 1) = k\)
k even: k − 1 is odd (and at least 1) and \(f(k - 1) = k\)
So f is one-one and onto, a bijection, and f(f(n)) = n for every n, so f is its own inverse.
Checking the statements
(A) f is injective — Correct. Different inputs never give the same output.
(B) f is into — Incorrect. An into function leaves some element of the co-domain without a pre-image; here every k has one.
(C) f is surjective — Correct. Every natural number k is f(k + 1) or f(k − 1).
(D) f is invertible — Correct. f is a bijection, and \(f^{-1} = f\).