<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] Your solution is almost correct. You should note that $x=0$ is neither a point of maximum or minimum, because $f(0)=0$, but $f(2)>0$ and $f(-2)<0$. So considering
$$
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}
$$
for $x\ne0$ is good: the restriction to $x\ne0$ has the same maximum and minimum values. Then the maximum and minimum values of $f$ coincide with the maximum and minimum values of
$$
g(t)=\frac{t}{t^2+1}
$$
because $t=x-1/x$ takes on every real number (twice). Since the substitution $\theta=2\arctan t$ is bijective from $\mathbb{R}$ onto $(-\pi,\pi)$, we can conclude that the function
$$
h(\theta)=\frac{1}{2}\sin\theta,
$$
on the interval $(-\pi,\pi)$, has the same maximum and minimum values as $g$ and so also as $f$. The maximum and minimum values are attained for $\theta=\pi/2$ and $\theta=-\pi/2$, respectively.
This corresponds to $t=\tan(\pi/4)=1$ and $t=\tan(-\pi/4)=-1$, respectively. From
$$
x-\frac{1}{x}=1
$$
we get
$$
x=\frac{1-\sqrt{5}}{2}\qquad\text{or}\qquad x=\frac{1+\sqrt{5}}{2}
$$
for the points of maximum for $f$. From
$$
x-\frac{1}{x}=-1
$$
we get
$$
x=\frac{-1-\sqrt{5}}{2}\qquad\text{or}\qquad x=\frac{-1+\sqrt{5}}{2}
$$
for the points of minimum for $f$.

This can be confirmed with a more tedious computation. We have
$$
f'(x)=\frac{(3x^2-1)(x^4-x^2+1)-(x^3-x)(4x^3-2x)}{(x^4-x^2+1)^2}
$$
and the numerator is
$$
N(x)=3x^6-x^4-3x^4+x^2+3x^2-1-4x^6+4x^4+2x^4-2x^2
$$
or
\begin{align}
N(x)&=-x^6+2x^4+2x^2-1\\[6px]
&=-(x^2+1)(x^4-x^2+1)+2x^2(x^2+1)\\[6px]
&=-(x^2+1)(x^4-3x^2+1)
\end{align}
Thus the derivative vanishes for
$$
x^2=\frac{3\pm\sqrt{5}}{2}=\frac{6\pm2\sqrt{5}}{4}=
\frac{(1\pm\sqrt{5})^2}{4}
$$
giving back the same points as before.
</s>