Understanding divison by monic polynomial in $R[x]$ where $R$ is an arbitrary ring
The reason $f$ has to be monic is that you can always divide by $1$, but not for other elements. Actually, the leading coefficient of $f$ can be any unit.
The proof is by induction on the degree of $g$; if $g$ is the zero polynomial, there is nothing to prove. If $g$ has degree zero and $f(x)=1$, write $g(x)=f(x)g(x)+0$; if $f$ has degree $>0$, $g(x)=f(x)\cdot 0+g(x)$.
Suppose $g$ has degree $n$ and that the statement holds for polynomials of degree $k<n$. Let's assume $\deg f=m$.
If $n<m$, we are done: $g(x)=f(x)\cdot 0+g(x)$. Otherwise, let $a_n$ be the leading coefficient of $g(x)$ and consider $$ g_1(x)=g(x)-a_nx^{n-m}f(x) $$ By construction, $\deg g_1<n$, so $g_1(x)=f(x)q_1(x)+r(x)$, with $\deg r<m$, by the induction hypothesis. Therefore $$ g(x)=g_1(x)+a_nx^{n-m}f(x)=f(x)(a_nx^{n-m}+q_1(x))+r(x) $$ and we are finished.
If the leading coefficient of $f(x)$ is a unit $u$, then $u^{-1}f(x)$ is monic, so $$ g(x)=u^{-1}f(x)q_0(x)+r(x) $$ by the previous result and now $q(x)=u^{-1}q_0(x)$ solves the problem.