TITLE: How to find inverse of a composite function?
QUESTION [7 upvotes]: I am stuck with this question,

Let $A=B=C=\mathbb{R}$ and consider the functions $f\colon A\to B$ and $g\colon B\to C$ defined by $f(a)=2a+1$, $g(b)=b/3$. Verify Theorem 3(b): $(g\circ f)^{-1}=f^{-1}\circ g^{-1}.$

I have calculated $f^{-1}$, $g^{-1}$,  and their composition, but how do I find the inverse of $(g\circ f)$?
Here is how I have done so far,

$$\begin{align*}
\text{Let}\qquad\qquad b &= f(a)\\
a&= f^{-1}(b)\\
&{ }\\
b&=f(a)\\
b&=2a+1\\
\frac{b-1}{2} &= a\\
a &= \frac{b-1}{2}
\end{align*}$$
  But $a=f^{-1}(b)$,
  $$f^{-1}(b) = \frac{b-1}{2}.$$

${}$

$$\begin{align*}
\text{Let}\qquad\qquad a&=g(b)\\
b&= g^{-1}(a)\\
a&= g(b)\\
a &= b/3\\
b &= 3a\\
g^{-1}(a) &= 3a\qquad(\text{because }b=g^{-1}(a)
\end{align*}$$

${}$

$$\begin{align*}
f^{-1}\circ g^{-1} &= ?\\
&= f^{-1}\Bigl( g^{-1}(a)\Bigr)\\
&= f^{-1}(3a)\\
f^{-1}\circ g^{-1} &= \frac{3a-1}{2}
\end{align*}$$
$$\begin{align*}
g\circ f&= g\bigl(f(a)\bigr)\\
&= g(2a+1)\\
g\circ f &= \frac{2a+1}{3}\\
(g\circ f)^{-1} &= ?\\
\text{Let}\qquad\qquad &b=g\circ f
\end{align*}$$

EDIT: 
Thanks for the answers, I followed the suggestions and came up with the answer,


Now I have two questions,

The answers do match but the arguments are different. Is that ok?
Is $(g\circ f)$ same as $(g\circ f(a))$?

REPLY [9 votes]: $f,g$ are the functions defined in the question.

We have
$$\begin{eqnarray*}
b &=&f(a)=2a+1, 
\end{eqnarray*}$$
or equivalently, by definition of the inverse function $f^{-1}$
$$\begin{eqnarray*}
&a=\frac{b-1}{2}=f^{-1}(b).\tag{A}
\end{eqnarray*}$$
Since 
$$\begin{eqnarray*}
c &=&g(b)=\frac{b}{3}, 
\end{eqnarray*}$$
or equivalently, by definition of the inverse function $g^{-1}$
$$\begin{eqnarray*}
b=3c=g^{-1}(c),\tag{B}
\end{eqnarray*}$$
after combining $(A)$ and $(B)$, we get
$$a=\frac{3c-1}{2}=(f^{-1}\circ g^{-1})(c).\tag{1}$$
On the other hand
$$c=(g\circ f)(a)=g(f(a))=g(2a+1)=\frac{2a+1}{3}.\tag{2}$$
Hence, by definition, the value at $c$ of the inverse function $(g\circ f)^{-1}$, is
$$a=\frac{3c-1}{2}=(g\circ f)^{-1}(c).\tag{3}$$
From $(1)$ and $(3)$ we conclude that for these functions $f,g$ and their inverses $f^{-1},g^{-1}$ the following identity holds:
$$(f^{-1}\circ g^{-1})(c)=(g\circ f)^{-1}(c).\tag{4}$$
Notation's note: $(f^{-1}\circ g^{-1})(c)=f^{-1}(g^{-1}(c))$.