Let $R$ be a commutative ring with unit.
The general statement of Euclidean Division in $R[x]$ is the following. If $f, g \in R[x]$ and $g \neq 0$ with the leading coefficient of $g$ being a unit, then $\exists q, r \in R[x]$ such that $f = qg + r$ and either $r = 0$ or $\deg(r) < \deg(g)$.
I have already shown the existence of $q, r$, and I am now trying to show their uniqueness. So for any $q', g' \in R[x]$ I want to start by showing that if $f = qg + r = q'g + r'$ then $q \neq q' \iff r \neq r'$. To do that I think I need to prove the following statement: if $f, g, h \in R[x]$ such that $f \neq 0$ and the leading coefficient of $f$ is a unit, then is it true that $fg = fh \implies g = h$. But I am struggling with the last part.