It is given that the function f( x ) is defined in the domain f:N→N and the function g( x ) is defined in the domain g:N→N.
Consider f( x )=x+1 and g( x )={ x−1 if x>1 1 if x=1 }.
First, show that the function g( x ) is not onto.
Consider an element 1 that exists in the co-domain N. Also, this element is not the image of any element in the domain N.
Thus, the function f is not onto.
Now, find the value of gof( x ).
gof( x )=g( f( x ) ) =g( x+1 ) =( x+1 )−1 =x
It can be observed that for y∈N, there exist x=y∈N such that gof( x )=y.
Hence, it is proved that gof is onto, but f is not onto.