Suppose that $f:A\rightarrow B$ and $g:B \rightarrow C$ are both one-to-one and onto. Prove that $gf$ is one-to-one and onto. Prove further that $(gf)^{-1} = f^{-1}g^{-1}$.
I have already proven the first part, but the second part has always puzzled me. I have tried assuming $x \in (gf)^{-1}$ but that doesn't lead to nowhere. Nor does $x \in (gf)^{-1}(t)$ and showing $x = t$. How to prove?