Let $R$ be an integral domain and $R[x]$ the polynomial ring over $R$. Let $f,g \in R[x]$ such that $\max(\deg f, \deg g)< \#R$. Show that $f=g \iff f(x)= g(x), \forall x \in R$.
$\bf Attempt:$ Since $f,g \in R[x]$, $$f(x)=a_0+a_1x +a_2x^2+ \dots + a_nx^n \\ g(x)=b_0+b_1x+b_2x^2+\dots+b_mx^m,$$ for some $a_i,b_j \in R \ (\text{with} \ 1\leq i \leq n, 1\leq j \leq m$). WLOG, $n<m$.
Assume that $f(x) = g(x)$ for all $x \in R$. Then $$a_0+a_1x +a_2x^2+ \dots + a_nx^n = b_0+b_1x+b_2x^2+\dots+b_mx^m.$$ In particular if $x=0$, this implies $a_0 = b_0$.
So $$a_1x +a_2x^2+ \dots + a_nx^n =b_1x+b_2x^2+\dots+b_mx^m \\ (a_1-b_1)x +(a_2-b_2)x^2+ \dots + (a_n-b_n)x^n-b_{n+1}x^{n+1} \dots -b_mx^m = 0. $$
After this point, I tried to make some argument that $n=m$ but ran into the problem that I could possibly have that $x^p=x^q$ for all $x \in R.$ So I can't claim that each of the coefficients is zero. I'm certain that I need to use the condition regarding the degrees of $f$ and $g$ but I'm not sure how to.