Well definition of multiplicity of a root in a polynomial of ring. Let $R$ be a conmutative ring with identity, let $\displaystyle f=\sum_{k=0}^{n}a_k x^k \in R[x]$ and $r\in R$. If $f=(x-r)^m g$, $m\in\mathbb{N}$ and $g\in R[x]$ with $g(r)\neq 0$, then the root $r$ is said to have $multiplicity\,\,\, m$. If the multiplicity is 1 the root is called simple.
How to prove that the above definition of the multiplicity of a root is well defined?

More generally, for $\rm\!\ c\in R\!\ $ any ring, every $\rm\!\ r\ne 0\,$ may be written uniquely in the form $\rm\!\ r = c^n\,\! b,\,$ where $\rm\,c\nmid b,\,$ assuming $\rm\,c\,$ is cancellable, and only $0\,$ is divisible by arbitrarily high powers of $\rm\,c.\,$  Indeed,  by hypothesis there exists a largest natural $\rm\,n\,$ such that $\rm\,c^n\,|\,r,\,$ hence $\rm\,r = c^n\, b,\ c\nmid b.\,$ Suppose $\rm\,r = c^k\:\! d,\ c\nmid d.\,$ If $\rm\,k < n,\,$ then cancelling $\rm\,c^k\,$ in $\rm\,c^n\:\! b = c^k\:\!d\,$ yields $\rm\,c^{n-k}\:\!b = d,\,$ so  $\rm\,c\,|\,d,\,$ contra hypothesis. Thus $\rm\,k = n,\,$ so cancelling $\rm\,c^k\,$ yields $\rm\,b = d,\,$ thus uniqueness. $\bf\small QED$
Your special case follows by applying the above to the cancellable element $\, {\rm c} = x-r\in R[x],\,$ which clearly satisfies the bounded divisibility hypothesis: $\,(x\!-\!r)^n\,|\,f\ne0\,\Rightarrow\, n\le \deg\ f.$
