Given function f = {(1, −1), (4, −2), (9, −3), (16, 4)} and g = {(−1, −2), (−2, −4), (−3, −6), (4, 8)}
f: {1, 4, 9, 16} → {-1, -2, -3, 4} and g: {-1, -2, -3, 4} → {-2, -4, -6, 8}
Co-domain of f = domain of g
Therefore, gof exists and gof: {1, 4, 9, 16} → {-2, -4, -6, 8}
(gof) (1) = g(f(1)) = g(−1) = −2
(gof) (4) = g(f(4)) = g(−2) = −4
(gof) (9) = g(f(9)) = g(−3) = −6
(gof) (16) = g(f(16)) = g(4) = 8
Therefore, gof = {(1, −2), (4, −4), (9, −6), (16, 8)}
The co-domain of g is not same as the domain of f.
Therefore, fog does not exist.