KCET 2014 Mathematics Paper

Mathematics Class XII Relations and Functions Types of Functions
Question 3

Let $f: N \rightarrow N $ defined by $f(N) = \begin{equation}
f(x)=\begin{cases}
\dfrac {n+1}{2} , & \text{if n is odd}.\\
\dfrac {n}{2} , & \text{if n is even}.
\end{cases}
\end{equation}$

then $f$ is