This is because $(f\circ g)(g^{-1} \circ f^{-1}) = f \circ g \circ g^{-1} \circ f^{-1} = \text{identity}$.
Therefore, $(f\circ g)^{-1} = g^{-1}\circ f^{-1}$.