Hint $\ $ Dividing a polynomial $\,f(x)\,$ by $\, x\!+\!1\,$ yields (via Polynomial Remainder Theorem)
$\qquad\qquad\ \ f(x) - (x\!+\!1) q(x) = f(-1)\ [\, =\color{#c00} 1\ \ {\rm for}\ f = x^3+x^2+1]$
Eval at $\,a$ $\overset{f(a)\,=\,0}\Longrightarrow -(a\!+\!1)\color{#0a0}{q(a)}\, = f(-1)\, =\, \color{#c00} 1\,$ in $\,\Bbb Z_2[a]\ $ so $\,(a\!+\!1)^{-1} = \,\color{#0a0}{-q(a)}$
Generally we see $\ (a\!+\!1)^{-1} = \dfrac{-q(a)}{f(-1)}\ $ if $\,f(-1)\,$ is a unit (invertible), where
$$ q(x)\, =\, \frac{f(x)-f(-1)}{x+1}\, \left[ = \frac{x^3+x^2}{x+1} = x^2\rm\ \ in\ \ OP\right]\qquad$$
Remark $\ $ Generally for coprime polynomials $\,f,g\,$ over a field we can use the extended Euclidean algorithm to obtain the Bezout identity $\,a f + b g = 1\,$ hence $\, g^{-1}\!\equiv b \pmod f.\ $ The above is simply the special case when the Euclidean algorithm terminates in a single step, i.e. when $\, f\ {\rm mod}\ g = c\,$ is constant, i.e. $\ f = qg + c,\,\ \deg c = 0.$