Given
and
So,
and
Domains of fog and gof are the same.
Now we have to find fog and gof also we have to check whether they are equal or not,
Consider (fog) (x) = f (g (x))
=
Now consider (gof) (x) = g (f (x))
So, (fog) (x) = (gof) (x),
Hence, fog = gof