# Give examples of two functions f : N → N and g : N → N such that gof is onto but f is not onto.

(Hint: Consider f (x) = x + 1 and g (x) = {x - 1, if x > 1; 1, if x = 1}

**Solution:**

If for every element of Y, there is at least one or more than one element matching with X, then the function is said to be onto function or surjective function.

Define f : N → Z as f (x) = x + 1

and g : Z → Z as

g (x) = {x - 1, if x > 1; 1, if x = 1}

Let us first show that g is not onto.

Consider element 1 in co-domain N.

This element is not an image of any of the elements in domain N.

⇒ f is not onto.

g : N → N is defined by

gof (x) = g (f (x)) = g (x + 1) = x + 1 - 1 = x [x ∈ N ⇒ x + 1 > 1]

For y ∈ N, there exists x = y ∈ N such that gof (x) = y.

Therefore,

gof is onto

NCERT Solutions for Class 12 Maths - Chapter 1 Exercise ME Question 7

## Give examples of two functions f : N → N and g : N → N such that gof is onto but f is not onto.

(Hint: Consider f (x) = x + 1 and g (x) = {x - 1, if x > 1; 1, if x = 1}

**Summary:**

f : N → Z as f (x) = x + 1 and g : Z → Z as g (x) = {x - 1, if x > 1; 1, if x = 1} are the examples of two functions f : N → N and g : N → N such that gof is onto but f is not onto