Why does the composition of functions $g(f(x))$ require the codomain of $f$, and not its image, be the same as the domain of $g$?

1.4k Views Asked by At

As the question title states, for a composition of functions $f(g(x))$ I was taught that the domain of $g$ has to be the same as the codomain of $f$. Why? Can't you say that the image of $f$ and the domain of g must be the same? Perhaps when I was taught it was simply poorly worded and should have been that the domain of $g$ must be a subset of the codomain of $f$? Surely only every point produced by the map $f$, ie $f$'s image, needs to be then mapped by $g$.

1

There are 1 best solutions below

0
On

When you have a composition of function written as $f(g(x))$ this is equivalent to

$x \rightarrow g(x) \rightarrow f(g(x))$

applying $g$ and then $f$ on the image of $g$. This operation makes sense only when the image of $g$ is contained in the domain of $f$