We will show that
$$g(x)=\left(\pi-2x\right) \tan x$$ is monotonically increasing on $(0,\pi/2)$. We have,
$$g'(x)=-2\frac{\sin x}{\cos x}+\frac{\pi-2x}{\cos^2 x}=0 \Leftrightarrow \pi-2x=2\sin x\cos x=\sin 2x \Leftrightarrow \sin 2x + 2x=\pi.$$ But $h(x)=\sin 2x + 2x$ is strictly increasing on $(0,\pi/2),$ since $h'(x)=2\cos 2x+2>0$ on $(0,\pi/2).$ Since $h(\pi/2)=\pi$ we have shown that $h(x)=\pi$ has no solution on $(0,\pi/2),$ that is, $g'(x)\ne 0$ on $(0,\pi/2).$ Since it is continuous, it easy to get that $g'(x)>0$ on such interval.
Now, $f(x)=\frac{x}{\pi}g(x)$ is monotonically increasing on $(0,\pi/2)$ as a product of two monotonically incrasing functions.