Show that there are polynomials $q(x)$ and $r(x)$ with integer coefficients such that $f(x)=g(x)q(x)+r(x)$ and $\deg(r)<\deg(g)$. Let $f(x), g(x)$ be polynomials with coefficients in $\mathbb Z$. Suppose that $\deg(g)≥1$ and that the leading coefficient of $g$ is $1$. Show that there are polynomials $q(x)$ and $r(x)$ with integer coefficients such that $f(x)=g(x)q(x)+r(x)$ and $\deg(r)&lt;\deg(g)$.
By letting $q=0, r=f$, we see that there are polynomials $q,r$ with integer coefficients such that $f=qg+r$. Among all such pairs of polynomials, pick one that minimizes $\deg r$. I claim that $\deg r&lt;\deg g$. Indeed, if we assume that $\deg r\ge \deg g$ is possible where $g(x)=x^n+a_{n-1}x^{n-1}+\ldots +a_0$ and $r(x)=b_mx^m+\ldots +b_0$ with $m\ge n$ and $b_m\ne 0$, say, then for $q^*(x):=q(x)+b_mx^{m-n}g(x)$ and $r^*(x):=r(x)-x^{m-n}g$ we have $f=q^*g+r^*$ and $\deg r^*&lt;m=\deg r$, contradiction.
You can get $q(x)$ by doing polynomial division of $\frac{f(x)}{g(x)}$. Then you will find out that all coefficients of $r(x)$ with degree$\ge \deg(g)$ is $0$. Therefore $\deg(r)&lt;\deg(g)$ or $r(x)=0$

It's called division algorithm for polynomials.