$g(x)=\dfrac{\cos x}{f(x)}$ $\implies g'(x)=-\dfrac{f(x)\sin x+f'(x)\cos x}{f(x)^2}$ You know that $f\left(\dfrac\pi3\right)=4$ and $f'\left(\dfrac\pi3\right)=-2$, so $g'\left(\dfrac\pi3\right)=-\dfrac{4\sin\frac\pi3-2\cos\frac\pi3}{4^2}=\dfrac{1-2\sqrt3}{16}$