A function f from the set of natural numbers to integers defined by f(n)={n−12,where n is odd−n2,where n is even is
f:N→I
f(1) = 0, f(2) = -1, f(3) = 1, f(4) = -2, f(5) = 2 and f(6) = -3 so on.
In this type of function every elements of set A has unique image in set B and there is no elements left in set B. Hence f is one - one and onto function.