gof is given by
f(1)=2 and g(2)=1 therfor gof(1)=g(f(1))=g(2)=1so we obtained (1,1).
Remember domain of gof is domain of f so we will apply the above given procedure for domain of f only.
Since every element of domain is associated to a unique element so gof is one to one function.
But for g we have (2,1) and (5,1) both domain elements are associated to same element so g not one to one