A function f from the set of natural numbers to integers defined by $f(n)=\left\{\begin{matrix}\frac{n-1}{2},&when\,n\,is\,odd\\-\frac{n}{2},&when\,n\,is\,even\end{matrix}\right.$ is
Answer & explanation
Correct answer: option 4
Clearly, range (f) = Z (Set of integers)
So, f is onto.
We observe that distinct odd natural numbers are mapped to distinct non-negative integers and distinct even natural numbers are mapped to distinct negative integers.
So, f is one-one.
Hence, f is both one-one and onto.