Integration problem with shadowy hint. Solving some integration problems this quarantine I found this one: 

Let $f, g:[0,\frac{\pi}{2}] \to \mathbb{R}$ be two class $C^1$ functions such that $$f(x)g(x) = \sin(x)$$ for each $x \in [0,\frac{\pi}{2}]$. Show that $$\int_{0}^{\frac{\pi}{2}} f'(x)g^2(x) \,\rm{d}x \neq -g(\frac{\pi}{2})$$


It looks very crazy. The text gives a hint: 

Proceed by contradiction. It will be necessary to integrate by parts a couple of times and the mean value theorem for integrals can be useful.

What I've tried: Of course follow the hint, assume the equality, and try to find any way to get $-g(x)$, also by mean value find some kind of expression for derivative of $fg$ but got not that much. I woul like to get some kind of "kickstart" to solve it. 
Any help is very welcome. Wash your hands and stay home. Thank You  !

You have\begin{align}\int_0^{\pi/2}f'(x)g^2(x)\,\mathrm dx&=\left[f(x)g^2(x)\right]_{x=0}^{x=\pi/2}-2\int_0^{\pi/2}f(x)g(x)g'(x)\,\mathrm dx\\&=\left[\sin(x)g(x)\right]_{x=0}^{x=\pi/2}-2\int_0^{\pi/2}\sin(x)g'(x)\,\mathrm dx\\&=g\left(\frac\pi2\right)-2\int_0^{\pi/2}\sin(x)g'(x)\,\mathrm dx\\&=g\left(\frac\pi2\right)-2\left(\left[\sin(x)g(x)\right]_{x=0}^{x=\pi/2}-\int_0^{\pi/2}\cos(x)g(x)\,\mathrm dx\right)\\&=-g\left(\frac\pi2\right)+2\int_0^{\pi/2}\cos(x)g(x)\,\mathrm dx\end{align}Since $g(x)\neq0$ for each $x\in\left(0,\frac\pi2\right]$ and it is continuous, then either you always have $g(x)>0$ there or you have $g(x)<0$. But $\cos(x)>0$ on $\left[0,\frac\pi2\right)$. So, $\int_0^{\pi/2}\cos(x)g(x)\,\mathrm dx\ne0$.
