TITLE: How to prove $(f \circ\ g) ^{-1} = g^{-1} \circ\ f^{-1}$? (inverse of composition)
QUESTION [15 upvotes]: I'm doing exercise on discrete mathematics and I'm stuck with question:

If $f:Y\to Z$ is an invertible function, and $g:X\to Y$ is an invertible function, then the inverse of the composition $(f \circ\ g)$ is given by $(f \circ\ g) ^{-1} = g^{-1} \circ\ f^{-1}$.

I've no idea how to prove this, please help me by give me some reference or hint to its solution.

REPLY [3 votes]: $f:Y \to Z$ and $g:X \to Y$ are invertible functions. We need to prove $(f\circ g)^{-1}=g^{-1}\circ f^{-1}$.
$$
(f\circ g)^{-1}\circ (f\circ g)=(g^{-1}\circ f^{-1})\circ(f\circ g)=(g^{-1}\circ f^{-1})\circ f)\circ g=(g^{-1}\circ (f^{-1}\circ f))\circ g=(g^{-1}\circ I_{Y})\circ g=g^{-1}\circ g=I_{X}
$$
Similarly,
$$
(f\circ g)\circ (f\circ g)^{-1}=(f\circ g)\circ (g^{-1}\circ f^{-1})=f\circ(g\circ (g^{-1}\circ f^{-1}))=f\circ((g\circ g^{-1})\circ f^{-1})\\=f\circ (I_{Y}\circ f^{-1})=(f\circ I_{Y})\circ f^{-1}=f\circ f^{-1}=I_{Z}
$$
$(g^{-1}\circ f^{-1})\circ(f\circ g)=I_{X}$ and $(f\circ g)\circ (g^{-1}\circ f^{-1})=I_{Y}$ proves $f\circ g$ is invertible with $(f\circ g)^{-1}=g^{-1}\circ f^{-1}$.