Let #f(x)=(x^2-x+1)/(x^2+x+1)#
Observe that #lim_(x->+-oo)(x^2-x+1)/(x^2+x+1)=lim_(x->+-oo)(1-1/x+1/x^2)/(1+1/x+1/x^2)=1#
Now #(df)/(dx)=((x^2+x+1)(2x-1)-(x^2-x+1)(2x+1))/(x^2+x+1)^2#
= #(2x^3+x^2+x-1-(2x^3-x^2+x+1))/(x^2+x+1)^2#
= #(2x^2-2)/(x^2+x+1)^2#
= #(2(x+1)(x-1))/(x^2+x+1)^2#
Hence, we have extrema at #x=1# and #x=-1#
and #(d^2f)/(dx^2)=(4x(x^2+x+1)^2-2(x^2+x+1)(2x+1)*2(x^2-1))/(x^2+x+1)^4#
= #(4x^5+8x^4+12x^3+8x^2+4x-8x^5-12x^4-4x^3+8x^2+12x-4)/(x^2+x+1)^4#
= #(-4x^5-4x^4+8x^3+16x^2+16x-4)/(x^2+x+1)^4#
At #x=1#, we have #f(x)=1/3# and #(d^2f)/(dx^2)=28/81# and
at #x=-1#, we have #f(x)=3# and #(d^2f)/(dx^2)=-12/81# hence maxima.
graph{(x^2-x+1)/(x^2+x+1) [-5.625, 4.375, -0.92, 4.08]}