Divide the polynomial $(x^2+1)(x+1)$ (multiplied out) by the polynomial $x^3+2x+1$, remembering to work with the right field of coefficients. The remainder (or more properly, its equivalence class) is what you want.
How to do the division? Basically like ordinary polynomial division. $x^3+2x+1$ goes into $x^3+x^2+x+1$ (our product) once. Subtract. We get $(x^3+x^2+x+1)-(x^3+2x+1)$, which is $x^2-x$, or equivalently $x^2+2x$.
Another way: In this case, we can take a shortcut, well, maybe not a shortcut, just another way of thinking. The polynomial $x^3+2x+1$ is equivalent to $0$, so $x^3$ is equivalent to $-2x-1$. So $x^3+x^2+x+1$ is equivalent to $(-2x-1)+(x^2+x+1$, which simplifies to $x^2-x$, or, equivalently, $x^2+2x$.