Composition of invertible functions proof I have this proof to do, I do not think it is too hard if you I know the rules I should apply. In particular, is there anything i can do with the -1's in this case?
If now, what rules can I apply to this to get this out?

$(f \circ g)^{-1} = g^{-1} \circ f^{-1}$

So I'm stuck here, 
$$(f \circ g)^{-1} = (f(g(x)))^{-1}$$
For example, I'm relearning a lot of stuff, I remember learning something like this:
$(AB)^{-1} = B^{-1} A^{-1}$
I'm thinking I can apply this? or is this result actually a result of the lemma I'm supposed to be proving anyway?
Help would be appreciate.
Thanks.
 A: We have the following definition of inverse function:

Let $F$ be a function. We say that $G$ is the inverse function of $F$ if it satisfies
  $$
G(F(x))=x,\ \forall x\in Dom\ F,
$$
  and
  $$
F(G(x))=x,\ \forall x\in Dom\ G.
$$
  In this case, we denote $G$ by $F^{-1}$.

We shall use the following basic stuff without mentioning:
i) $F^{-1}$ is unique;
ii) $(F^{-1})^{-1} = F$;
iii) $Im\ F^{-1} = Dom\ F$;
iv) $Im\ F = Dom\ F^{-1}$.
Let us consider the functions $f$ and $g$ of our problem. 
Notice that there is a condition that is implicitly assumed. To be able to do the composition $f\circ g$, we must have that 
$Im\ g \subset Dom\ f$. On the other hand, to be able to do the composition $g^{-1}\circ f^{-1}$, we must have $Im\ f^{-1} \subset Dom\ g^{-1}$, then
$$
Dom\ f = Im\ f^{-1} \subset Dom\ g^{-1} = Im g.
$$
Therefore, the identity is implicitly assumed:

$Im\ g= Dom\ f$.

Now, let us prove that $(f\circ g)^{-1} = g^{-1}\circ f^{-1}$.
The function $f^{-1}$ satisfies
$$
f^{-1}(f(x))=x,\ \forall x\in Dom\ f.
$$
In particular, for any $y\in Dom\ g$, we have that $g(y)\in Im g = Dom\ f$, and consequently, substituing $x$ by $g(y)$ above, we get
$$
f^{-1}(f(g(y)))=g(y),
$$
so $f^{-1}(f(g(y)))\in Im\ g = Dom\ g^{-1}$, and, applying $g^{-1}$ above, we get
$$
g^{-1}(f^{-1}(f(g(y))))=g^{-1}(g(y)) = y.
$$
This way we proved that 

$(g^{-1}\circ f^{-1})((f\circ g)(y))=y,\ \forall y\in Dom\ g = Dom\ (f\circ g).$

Now, this fact is valid for any two invertible functions $f$, $g$ such that $Dom\ f= Im\ g$. But notice that
$$
Dom\ g^{-1}= Im\ g = Dom\ f = Im\ f^{-1}.
$$
Then the equality above is also valid if we replace $f$ by $g^{-1}$ and $g$ by $f^{-1}$. Then

$(f\circ g)((g^{-1}\circ f^{-1})(y))=y,\ \forall y\in Dom\ (g^{-1}\circ f^{-1}).$ 

By the definition of inverse function, the two underlined properties imply that $(g^{-1}\circ f^{-1})=(f\circ g)^{-1}$.
