How to determine the range of the function

$$f(x)=\tan \left( \frac\pi2 \frac{(1+x)^2}{3+x^2}\right)
\tan \left( \frac\pi2 \frac{(1-x)^2}{3+x^2}\right)
$$

It it is straightforward to verify that $f(x)$ is even and

$$f(0)= \frac13, \>\>\>\>\> \lim\_{x\to\pm \infty} f(x) \to -\infty$$

which implies $f(x) \in (-\infty,\frac13]$, i.e.

$$\tan \left( \frac\pi2 \frac{(1+x)^2}{3+x^2}\right)
\tan \left( \frac\pi2 \frac{(1-x)^2}{3+x^2}\right)\le \frac13
$$

and is visually confirmed below

[![enter image description here](https://i.stack.imgur.com/RO6nQ.png)](https://i.stack.imgur.com/RO6nQ.png)

However, it is not obvious algebraically that $f(x)$ monotonically decreases away from $x=0$. The standard derivative tests are not viable due to their rather complicated functional forms.

So, the question is how to prove the inequality $f(x) \le \frac13$ with rigor.

Note that it is equivalent to proving

$$\cot \left(\frac{\pi(1+x)}{3+x^2}\right)
\cot \left(\frac{\pi(1-x)}{3+x^2}\right)\le \frac13
$$