\(A=\dfrac{a^2+a-1}{a^2+a+1}\)
\(\Leftrightarrow\left(A-1\right)a^2+\left(A-1\right)a+A+1=0\)
Để PT theo nghiệm a có nghiệm thì
\(\Delta=\left(A-1\right)^2-4\left(A-1\right)\left(A+1\right)\ge0\)
\(\Leftrightarrow-3A^2-2A+5\ge0\)
\(\Leftrightarrow-\dfrac{5}{3}\le A\le1\)
Vậy \(\left\{{}\begin{matrix}max=1\\min=-\dfrac{5}{3}\end{matrix}\right.\)