So, this question is basically asking us "If we had an x instead of a 2, would this be true?" We can try and see what we get:
[tex] \frac{x^3+x^2+x}{x^2+x+1}=x [/tex]
So, if we want to show this we have to change the numerator or denominator in such a way that we can cancel some common factors. Notice that [tex] x^3+x^2+x=x(x^2+x+1) [/tex]
If we replace the factored numerator with the original one, we get:
[tex] \frac{x(x^2+x+1)}{x^2+x+1}=x \implies \\
x=x [/tex]
Since we have an equality, this relation is proved.