<s>[INST] Multiplicative inverse of $2x + 3 + I$ in $\mathbb{Z}_5[x]/I $? In $\mathbb{Z}_5[x]$, let $ I = \langle x^2 + x + 2\rangle$. Find the multiplicative inverse of $2x + 3 + I$ in $\mathbb{Z}_5[x]/I$. 
The answer is supposed to be $3x + 1 + I$. But I don't understand how you find this. I divided $x^2 + x + 2$ by $2x+3$ to get $$ x^2 + x + 2 = (2x + 3)(3x + 1) + 4.$$ But I'm not sure how this will help me. I know that the elements of $\mathbb{Z}_5[x]/I$ are of the form $ax + b$, with $a, b \in \mathbb{Z}_5$. So I want $$ 1 + I = (ax + b)(2x+3) + I = (2ax^2 + (3a+2b)x + 3b) + I. $$ I want to find the coefficients $a, b$ from this. We must have $3b = 1$, and the coefficients by $x$ and $x^2$ must vanish. Since $\mathbb{Z}_5$ is a field, the relation $3b = 1$ means $b$ is the multiplicative inverse of $3$. So $b = 2$. From the coefficients of $x$, I get also $3a = -2b$. I multiply this with $2$ to get $a = 6a = -4b = -8 = 2$. 
So I would say the inverse is $2x + 2$, in contradiction with the answer at the back of my book. So where is the mistake in my reasoning, and how to find correct answer? 
 [/INST] Your original approach was on the right track.  By dividing, you found that
$$
x^2 + x + 2 = (2x + 3)(3x + 1) + 4 \, .
$$
Rearranging, we have
\begin{align*}
(2x + 3)(3x + 1) = -4 + x^2 + x + 2 = 1 + x^2 + x + 2 \equiv 1 \pmod{x^2 + x + 2}
\end{align*}
so $3x + 1$ is the inverse of $2x+3$.
In general, if you have the equality $a f + b g= u$ where $u$ is a unit, you can multiply through by $u^{-1}$ to get a linear combination that yields $1$: $u^{-1} a f + u^{-1} b g = 1$.
</s>