(i) Let f: Z → Z given by f(x) = 3x + 2
We have to check one-one condition on f(x) = 3x + 2
Injectivity:
Let x and y be any two elements in domain (Z), such that f(x) = f(y).
f(x) = f(y)
⇒ 3x + 2 = 3y + 2
⇒ 3x = 3y
⇒ x = y
⇒ f(x) = f(y)
⇒ x = y
Therefore, f is one-one.
Surjectivity:
Let y be any element in the co-domain (Z), such that f(x) = y for some element x in Z(domain).
Let f(x) = y
⇒ 3x + 2 = y
⇒ 3x = y – 2
⇒ x = (y – 2)/3. It may not be in the domain (Z)
Because if we take y = 3,
x = (y – 2)/3 = (3 - 2)/3 = 1/3 ∉ domain Z.
So, for every element in the co domain there need not be any element in the domain such that f(x) = y.
Thus, f is not onto.
(ii) Example for function which is not one-one but onto
Let f: Z → N ∪ {0} given by f(x) = |x|
Injectivity:
Let x and y be any two elements in domain (Z),
Such that f(x) = f(y).
⇒ |x| = |y|
⇒ x = ± y
So, different elements of domain f may give the same image.
Therefore, f is not one-one.
Surjectivity:
Let y be any element in co domain (Z), such that f(x) = y for some element x in Z (domain).
f(x) = y
⇒ |x| = y
⇒ x = ± y
Which is an element in Z (domain). So, for every element in the co-domain, there exists a pre-image in the domain.
Thus, f is onto.
(iii) Example for function which is neither one-one nor onto.
Let f: Z → Z given by f(x) = 2x2 + 1
Injectivity:
Let x and y be any two elements in the domain (Z), such that f(x) = f(y).
f(x) = f(y)
⇒ 2x2 +1 = 2y2 +1
⇒ 2x2 = 2y2
⇒ x2 = y2
⇒ x = ± y
So, different elements of domain f may give the same image.
Thus, f is not one-one.
Surjectivity:
Let y be any element in co-domain (Z), such that f(x) = y for some element x in Z (domain).
f(x) = y
⇒ 2x2 + 1 = y
⇒ 2x2 = y − 1
⇒ x2 = (y - 1)/2
⇒ x = √((y - 1)/2) ∉ Z always.
For example, if we take, y = 4,
x = ± √((y - 1)/2)
= ± √((4 - 1)/2)
= ± √(3/2) ∉ Z
Therefore, x may not be in Z (domain).
Hence, f is not onto.