In the book Quantum Field Theory for the Gifted Amateur, the authors used the derivation shown below:
I have trouble understanding the step in equation 1.16. Shouldn't the term $\frac{dg(f')}{df'} $ replaced by $\frac{dg(f')}{dx} $. The authors used $\frac{dg(f)}{dx} $ in a similar derivation below.


The idea is that $g = g(f')$. To make it a bit clearer, call $\omega = f'(x)$, that means that
$$ g(\omega) = g(\omega_0) + (\omega - \omega_0)\left.\color{red}{\frac{{\rm d} g(\omega)}{{\rm d}\omega}}\right|_{\omega_0} + \cdots $$
That means that the linear term in the expansion is actually
$$ \color{red}{\frac{{\rm d} g(\omega)}{{\rm d}\omega}} = \frac{{\rm d} g(f')}{{\rm d}f'} $$
Of course you use the chain rule and further expand it in terms of $x$