23. For particular real numbers $a$ and $b$, the function $f$ is defined by $f(x)=a x+b$, and is such that $f(f(f(x)))=27 x-52$.
Which of the following formulas defines the function $g$ such that, for all values of $x$, $g(f(x))=x$ ?
A $\frac{1}{3} x-4$
B $\frac{1}{3} x+\frac{4}{3}$
C $4 x-3$
D $\frac{1}{3} x-\frac{4}{3}$
E $3 x-4$
Solution
B

Because $f(x)=a x+b$, we have that, for all real numbers $x$,
$$
\begin{aligned}
f(f(x)) & =f(a x+b) \\
& =a(a x+b)+b \\
& =a^{2} x+a b+b .
\end{aligned}
$$

It follows that, for all real numbers $x$,
$$
\begin{aligned}
f(f(f(x))) & =f\left(a^{2} x+a b+b\right) \\
& =a\left(a^{2} x+a b+b\right)+b \\
& =a^{3} x+a^{2} b+a b+b \\
& =a^{3} x+\left(a^{2}+a+1\right) b .
\end{aligned}
$$

Because the expressions $a^{3} x+\left(a^{2}+a+1\right) b$ and $27 x-52$ have the same value for all real numbers $x$, their coefficients match. Hence $a^{3}=27$ and $\left(a^{2}+a+1\right) b=-52$. It follows that $a=3$ and hence $13 b=-52$, giving $b=-4$. Therefore the function $f$ is defined by $f(x)=3 x-4$.
COMMENTARY
We now need to find the formula for the function $g$ such that $g(f(x))=x$. If $f(x)=y$ this implies that $g(y)=x$. Hence the method we use is to start with the equation $y=f(x)$ and then rearrange this so that it has the form $x=g(y)$.

We have
$$
\begin{aligned}
y=f(x) & \Leftrightarrow y=3 x-4 \\
& \Leftrightarrow 3 x=y+4 \\
& \Leftrightarrow x=\frac{1}{3} y+\frac{4}{3} .
\end{aligned}
$$

It follows that $g$ is given by the formula $g(y)=\frac{1}{3} y+\frac{4}{3}$. Rewriting this formula in terms of $x$ gives $g(x)=\frac{1}{3} x+\frac{4}{3}$.