<s>[INST] Calculation of $\max$ and $\min$ value of $f(x) = \frac{x(x^2-1)}{x^4-x^2+1}.$ 
Calculation of $\max$ and $\min$ value of $$f(x) = \frac{x(x^2-1)}{x^4-x^2+1}$$

My try: We can write $$f(x) = \frac{\left(x-\frac{1}{x}\right)}{\left(x^2+\frac{1}{x^2}\right)-1} = \frac{\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^2+1}$$ 
Now put $\left(x-\frac{1}{x}\right)=t,x\ne0$. Then we get $$f(t) = \frac{t}{t^2+1} = \frac{1}{2}\left(\frac{2t}{1+t^2}\right)$$
Now put $t=\tan \theta$. Then $$f(\theta) = \frac{1}{2}\frac{2\tan \theta}{1+\tan^2 \theta} = \frac{1}{2}\sin 2\theta$$
So we get $$-\frac{1}{2}\leq f(\theta)\leq \frac{1}{2}\Rightarrow f(\theta)\in \left[-\frac{1}{2}\;,\frac{1}{2}\right]$$
My question is: Is my solution right? If not, then how can we solve it?
 [/INST] take you solution,
$$f(t)=\dfrac{t}{t^2+1}$$
since
$$f(t)=-f(-t)$$
so we only consider $t\ge 0$ Use AM-GM inequality we have
$$f(t)=\dfrac{t}{t^2+1}\le\dfrac{t}{2t}=\dfrac{1}{2}$$
</s>