Note $\rm\ a_i\ne a_j\ \Rightarrow\ x-a_i\ $ are nonassocate primes in $\rm\:R[x],\:$ since $\rm\: R[x]/(x-a) \cong R\:$ is a domain.
Therefore $\rm\ \ x-a_1\ |\ f(x),\ \ldots\:,\: x-a_n\ |\ f(x)\ \ \Rightarrow\ \ (x-a_1)\cdots (x-a_n)\ |\ f(x) $
since LCM = product for nonassociate primes. But this is contra degree if $\rm\ n > deg\ f\:.$
Remark $\ $ In fact a ring $\rm\: D\:$ is a domain $\iff$ every nonzero polynomial $\rm\ f(x)\in D[x]\ $ has at most $\rm\ deg\ f\ $ roots in $\rm\:D\:.\:$ For the simple proof see my post here, where I illustrate it constructively in $\rm\: \mathbb Z/m\: $ by showing that, $\:$ given any $\rm\:f(x)\:$ with more roots than its degree,$\:$ we can quickly compute a nontrivial factor of $\rm\:m\:$ via a $\rm\:gcd\:$. The quadratic case of this result is at the heart of many integer factorization algorithms, which try to factor $\rm\:m\:$ by searching for a nontrivial square root in $\rm\: \mathbb Z/m\:,\:$ e.g. a square root of $1$ that is not $\:\pm 1$.