Let $$ \begin{aligned} & f(x)=a_{n} x^{n}+a_{n-1} x^{n-1}+\cdots+a_{1} x+a_{0} \\ & g(x)=b_{m} x^{m}+b_{m-1} x^{m-1}+\cdots+b_{1} x+b_{0} . \end{aligned} $$
Case 1. $n<m$.
Let $Q(x)=0$ and $R(x)=f(x)$.
Then
$$
f(x)=Q(x) g(x)+R(x) \text { and } \operatorname{deg}(R)<\operatorname{deg}(g) .
$$
Case 2. $n \geqslant m$.
For any $i, n \geqslant i \geqslant m$,
$$ a_{i} x^{i}=\frac{a_{i}}{b_{m}} x^{i-m}\left(b_{m} x^{m}+b_{m-1} x^{m-1}+\cdots+b_{1} x+b_{0}\right)-\frac{a_{i}}{b_{m}} b_{m-1} x^{i-1}-\frac{a_{i}}{b_{m}} b_{m-2} x^{i-2}-\cdots-\frac{a_{i}}{b_{m}} b_{0} x^{i-m} . $$
This implies that every term $a_ix^i$ in $f$ with $i\ge deg(g)$ can be written as the product of $\frac{a_i}{b_m}x^{i-m}$ and $g$, and a subtraction of smaller degree terms. Therefore $f$ can be written in a form that is a summation of two types of terms:
- $c_ix^ig(x)$ where $c_i$ is the coefficient and $i\ge deg(g)$.
- $c_ix^i$ where $i<deg(g)$.
Therefore
$$ f(x)=\sum_{i=m}^{n} c_{i} x^{i-m}\left(b_{m} x^{m}+b_{m-1} x^{m-1}+\cdots+b_{1} x+b_{0}\right)+\sum_{i=0}^{m-1} c_{i} x^{i} . $$
Let $Q(x)=\sum_{i=m}^{n} c_{i} x^{i-m}$ and $R(x)=\sum_{i=0}^{m-1} c_{i} x^{i}$.
Then
$$
f(x)=Q(x) g(x)+R(x) \quad \text { and } \operatorname{deg}(R)<\operatorname{deg}(g) .
\;\square$$
Is the proof valid? In case 2 the idea is that any term in $f(x)$ with exponent $\ge deg(g)$ can be written as a product of a term and $g(x)$, and a subtraction of some terms with a smaller exponent. This then implies that $f(x)$ can be written as containing two types of terms:
- The ones that are being multiplied by $g(x)$
- The ones with exponent $<deg(g)$
Then the sum of terms of type (1) is a polynomial being multiplied by $g(x)$, and sum of terms of type (2) is a polynomial of degree $<deg(g)$.
Example: $f(x)=x^3-1$, $g(x)=x+1$.
Then for the first term in $f(x)$, $x^3$, we can write $x^3=x^2(x+1)-x^2$. Substitute into the original expression: $f(x)=x^2(x+1)-x^2-1$. So we have just converted $x^3$ into two terms: $x^2(x+1)$ and $-x^2$. We can do the same thing for any term $deg\ge x+1$. The rest of the terms are gonna have $deg<x+1$.
full example:
$$f(x)=x^3-1=x^2(x+1)-x^2-1=x^2(x+1)-x(x+1)+x-1=x^2(x+1)-x(x+1)+(x+1)-2,$$
so $$f(x)=(x^2-x+1)(x+1)-2$$