Using the chain rule to solve a derivative

Let $f$ be a differentiable function and put $g(x):=f(x)^2.$ Then $g(x)=h(f(x)),$ with $h(x)=x^2.$

The chain rule gives:

$$g'(x)=h'(f(x)) f'(x)=2f(x)f'(x).$$