Let $f=x^3+x+1$, I want to find a inverse of $g=x^4 +3x^3+x^2+1$ in $A=\mathbb{Z}_5[x]/(f)$.
I do the division between $f$ and $g$ is $q=x+3$ and $r=2x+3$, then I continued with the division between $x^3+x+1$ and $r$ and then I have rest $=1$.
Now I don't know how to move in order to find the inverse.
Thanks for the attention.