Well, I got stuck in that question:
Consider the integral expression in $x$: $P = x^3+x^2+ax+1$ where $a$ is a rational number. At $a=A$ the value of $P$ is a rational number for any $x$ which satisfies the equation $x^2+2x-2=0$, and in this case the value of $P$ is $B$. Find $A$ and $B$.
I've tried to use the last equation in the first one, I multiplied it by $x$ and then I got $x^3 = 2x-2x^2$ and I put that in place of $x^3$ in $P$ and this led me to $P = -x^2+(2+a)x+1$. I thought that as $P$ is a rational number, I would choose a rational number to put in place of $P$, but I don't know if this expression includes all rational numbers. Anyway, I tried the value $P=1$ and this led me to $x=2+a$, well, this didn't help, I was trying to find $a$ and I found an $x$ that makes $P$ be $1$.