If $p(x)\in F[x]$ have root $r$ show that $x-r$ is a factor of $p(x)$ This is an exercise of Advanced linear algebra of Steven Roman:

Let $F$ a finite field and $p(x)\in F[x]$ a nonconstant polynomial such that $p(r)=0$. Show that $x-r$ is a factor of $p(x)$.

This exercise appear after some theory of cyclic decomposition of torsion modules over PIDs, however I dont have any clue about how to show that. Also I dont found anything useful from previous chapters of the book to solve this question.
My first idea was trying to see if $F[x]$ is a PID, what would imply that each ideal is principal, and so, as a $F[x]$ module, it would imply that the submodule defined by $S_r:=\{p(x)\in F[x]: p(r)=0\}$ would be cyclic, finishing the proof. However it seems not the case that $F[x]$ is a PID, otherwise $x-r$ and $p(x)$ would be associated, meaning that $p(x)=u(x)(x-r)$ where $u(x)$ is a unit (that is, that have inverse).
Im really stuck with this exercise, some help will be appreciated, thank you.
NOTE: this doesn't answer my question, because it doesn't show why $x-r\mid p(x)$. Searching for proofs about the division algorithm on polynomial rings it seems that it just hold whenever the ring is an integral domain, however nothing related to this topic is stated in the book, so I assume that it may exist a different way to answer the question.
 A: This is a basic fact about polynomials with coefficients in an arbitrary commutative ring $R$.
Without the division algorithm, you can prove that, for any positive integer $k$,
$$
x^k-r^k=(x-r)(x^{k-1}+rx^{k-2}+\dots+r^{k-2}x+r^{k-1})
$$
and therefore, if $f(x)=a_0+a_1x+\dots+a_nx^n$ and $f(r)=0$, we have
$$
f(x)=f(x)-f(r)=a_1(x-r)+a_2(x^2-r^2)+\dots+a_n(x^n-r^n)
$$
so we're done.
Alternatively, prove by induction on the degree of $f$ that, for every monic polynomial $g(x)$, there exist $Q(x)$ and $R(x)$ with $\deg R<\deg g$ (or $R=0$) and $f(x)=g(x)Q(x)+R(x)$.
Indeed, this is obvious when $f$ is constant. If $\deg f(x)<\deg g(x)$ there is nothing to prove. If $m=\deg f(x)\ge\deg g(x)=n$, suppose the leading coefficient of $f$ is $a_m$. Then the polynomial
$$
f_1(x)=f(x)-a_mx^{m-n}g(x)
$$
has degree less than the degree of $f$ and the induction hypothesis applies, so $f_1(x)=g(x)Q_1(x)+R(x)$ with $\deg R<\deg g$; now
$$
f(x)=a_mx^{m-n}g(x)+f_1(x)=g(x)(a_mx^{m-n}+Q_1(x))+R(x)
$$
As you see, nowhere it is used that the ring is an integral domain.
For the particular case, note that when $g(x)=x-r$, the remainder is constant and from $f(x)=(x-r)Q(x)+R$ we derive that $f(r)=R$.
