first, we have to see how this relates to the matrix A.
what does the matrix A do to a polynomial p(x) = ax2+bx+c = [a,b,c] in the basis {x2,x,1}?
it takes [a,b,c] to [a-b+c,a+b+c,25a+5b+c].
note that p(-1) = a(-1)2 + b(-1) + c = a-b+c
p(1) = a+b+c
p(5) = a(52) + b(5) + c = 25a+5b+c.
so A takes p(x) to q(x) = p(-1)x2 + p(1)x + p(5).
suppose we are just given q(x), then to find p(x) we take A-1(q(x)).
we are told by the problem that q(x) = -x2+3x+31, which in our basis is [-1,3,31]. find A-1 of this vector.
(the fact that A is invertible means there is only ONE polynomial p(x) in P2 with this property).