How to find inverse of a composite function? 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))$?

 A: What you've done so far is to compute $f^{-1}$ and $g^{-1}$, and $f^{-1}\circ g^{-1}$. Now you want to try to find $(g\circ f)^{-1}$ directly, and compare that to what you've computed (in order to verify the formula).
So, you've figured out that $(g\circ f)(a) = \frac{2a+1}{3}$. How do we figure out $(g\circ f)^{-1}$?
Exactly the same way we figure out the inverse of any function. If someone stopped you on the street, pointed a gun at you and said

"Here, I have this function:
  $$h(a) = \frac{2a+1}{3},$$
  I need the formula for $h^{-1}$. Give it to me or I'll shoot you!"

then you don't need to know where that function came from, all you need to do is figure out the inverse:
$$\begin{align*}
b &= \frac{2a+1}{3}\\
3b &= 2a+1\\
3b-1 &= 2a\\
&\vdots
\end{align*}$$
etc. When you are done and have a formula for $h^{-1}(a) = (g\circ f)^{-1}(a)$, you can compare it to the formula you found for $f^{-1}\circ g^{-1}$ and verify that you got the same function.
A: You find the inverse of $g\circ f$ by using the fact that $(g\circ f)^{-1} = f^{-1} \circ g^{-1}$.
In other words, what gets done last gets undone first.
$f$ multiplies by 2 and then adds 1.
$g$ divides by 3.
Dividing by 3 is done last, so it's undone first.
The inverse first multiplies by 3, then undoes $f$.
Later note: Per the comment, to verify that $(g\circ f)^{-1} = f^{-1} \circ g^{-1}$:
Instead of confusingly writing $a = g(b)$, write $c=g(b)$.  Then $c=b/3$, so $b=3c$, so
$$g^{-1}(c) = 3c.$$  And $$f^{-1}(b) = \frac{b-1}{2}.$$
So
$$
b = 3c\qquad\text{and}\qquad a = \frac{b-1}{2}.
$$
Put $3c$ where $b$ is and get
$$
a=\frac{3c-1}{2}.
$$
You want to show that that's the same as what you'd get by finding $g(f(a))$ directly and then inverting.
So $c = g(f(a)) = \dfrac{f(a)}{3} = \dfrac{2a+1}{3}$.
So take $c = \dfrac{2a+1}{3}$ and solve it for $a$:
$$
\begin{align}
3c & = 2a+1 \\
3c - 1 & = 2a \\  \\
\frac{3c-1}{2} & = a.
\end{align}
$$
FINALLY, observe that you got the same thing both ways.
A: $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))$.
