Question:
Let f = {(1, −1), (4, −2), (9, −3), (16, 4)} and g = {(−1, −2), (−2, −4), (−3, −6), (4, 8)}. Show that gof is defined while fog is not defined. Also, find gof.
Solution:
f = {(1, −1), (4, −2), (9, −3), (16, 4)} and g = {(−1, −2), (−2, −4), (−3, −6), (4, 8)}
$f:\{1,4,9,16\} \rightarrow\{-1,-2,-3,4\}$ and $g:\{-1,-2,-3,4\} \rightarrow\{-2,-4,-6,8\}$
Co-domain of f = domain of g
So, gof exists and gof: $\{1,4,9,16\} \rightarrow\{-2,-4,-6,8\}$
$(g o f)(1)=g(f(1))=g(-1)=-2$
$(g o f)(4)=g(f(4))=g(-2)=-4$
$(g o f)(9)=g(f(9))=g(-3)=-6$
$(g o f)(16)=g(f(16))=g(4)=8$
So, gof $=\{(1,-2),(4,-4),(9,-6),(16,8)\}$
But the co-domain of g is not same as the domain of f.
So, fog does not exist.