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))$?


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.
