TITLE: If $f \circ g$ is invertible, is $(f \circ g)^{-1} = g^{-1} \circ f^{-1}$?
QUESTION [5 upvotes]: If $f \circ g$ is invertible, is $(f \circ g)^{-1} = g^{-1} \circ f^{-1}$?
If not can someone give me a counterexample?

REPLY [5 votes]: Let $ f:\{0,1\} \rightarrow \{0\} $ be defined by
$ f(0) = 0 = f(1) $
and define $ g:\{0\} \rightarrow \{0\} $ with obvious mapping $g(0) = 0$ 
then $ f \circ g  $ is defined from $ \{0\} $ to $ \{0\} $ with $ (f \circ g) (0) = 0 $ and $ (f \circ g)^{-1} (0) = 0 $
but f is not invertible.