It is straightforward to see that $f(x)=\pi-2\arctan(x)$ for all $x\geq 0$.