Linear independence.
Suppose
a(x^2 + x + 1) + b(x^2 + x) + c(x + 1) = 0.
Then after simplifying, we have
(a + b)x^2 + (a + b + c)x + (a + c) = 0.
This means that
(a + b) = 0,
(a + b + c) = 0,
(a + c) = 0.
Subtracting the first eq. from the second gives us c = 0. Plugging c into the last equation gives us a = 0 and plugging a into the first eq. gives us b = 0. Thus a = b = c = 0. The only way to combine these three polynomial vectors to give zero is if we multiply each by zero. Thus they are linearly independent.
Spanning set.
Suppose we have a polynomial Ax^2 + Bx + C. We want to show that we can obtain this polynomial by a suitable linear combination of {x^2+x+1, x^2+x, x+1}. Writing this out we wish to solve
Ax^2 + Bx + C = a(x^2 + x + 1) + b(x^2 + x) + c(x + 1) = (a + b)x^2 + (a + b + c)x + (a + c).
Equating coefficients, we have
(a + b) = A,
(a + b + c) = B,
(a + c) = C.
Subtracting the first eq. from the second gives us c = B - A. Plugging c into the last equation gives us a = C - B + A and plugging a into the first eq. gives us b = B - C. Thus a suitable choice of a, b, and c can give us any polynomial in P2 so that choice c represents a spanning set.