Please Login to access more options.
Problem 39.5 (Function Composition Is Associative)
Let $f:A\to B$, $g:B\to C$, and $h:C\to D$ be functions. Recall that $g\circ f:A\to C$ is a new function defined by $(g\circ f)(x) = g(f(x))$, i.e. first put $x$ into $f$ to obtain $f(x)$ and then put $f(x)$ into $g$ to obtain $g(f(x))$.
Prove that function composition is associative, i.e. show that $h\circ (g\circ f)=(h\circ g)\circ f$.
Remember, to show that two functions $p:X\to Y$ and $q:V\to W$ are equal, you must show that they (1) have the same domains $X=V$, (2) they have the same codomains $Y=W$, and (3) that $p(x)=q(x)$ for each $x\in X$.
Click to see a solution.
First note that $h\circ (g\circ f)$ and $(h\circ g)\circ f$ have the same domain $A$ and codomain $D$. All we must show now is that $(h\circ (g\circ f))(x)=((h\circ g)\circ f)(x)$ for every $x\in A$. Let $x\in A$. We then compute $$(h\circ (g\circ f))(x) = h((g\circ f)(x)) = h(g(f(x))).$$ We can also compute $$((h\circ g)\circ f)(x) = (h\circ g)(f(x)) = h(g(f(x))).$$ This proves that $(h\circ (g\circ f))(x)=((h\circ g)\circ f)(x)$, as desired.
The following pages link to this page.