Question on finding maximum of AM GM inequality How can i solve for minimum value of function $f(x)=\frac{x^2+x+1}{x^2-x+1} $ using AM GM inequality.
I am aware about the AM GM inequality, but am not able to split the terms into the correct form in order to apply the inequality

we prove the answer is $\frac{1}{3}$ which happens at $x=-1$ for proving it we have :
$$\frac{x^2+x+1}{x^2-x+1} \ge \frac{1}{3}$$
if and only if
$$3x^2+3x+3 \ge x^2-x+1$$
if and only if
$$2x^2+4x+2=2(x+1)^2 \ge 0$$
[edit] if you think that it is not AM_GM here is a solution which is the same but the use of AM_GM is more clear on it.
$$\frac{x^2+x+1}{x^2-x+1}=1+\frac{2}{x+\frac{1}{x}-1} \ge 1 +\frac{2}{-2-1}= \frac{1}{3}$$
(we used $\frac{1}{x+\frac{1}{x}-1}\ge \frac{1}{-3}$ for possitive $x$ it is trivially true and for negative ones it is an AM_GM on $-x+\frac{-1}{x} \ge 2$)
