Infinite Integral Domains Let $D$ be an infinite integral domain, and let $g,h \in D[X]$. Show that if $g(x) = h(x)$ for all $x \in D$, then $g = h$.
I understand this means a one-to-one correspondence, but how do I go about proving it. Is it as simple as saying that because the degrees are the same, then the polynomials are the same?
Not really sure how to specify a formal proof, so any help would be appreciated.
Thanks
 A: If $f=g-h$ and $K$ is the quotient field of $D$ then $f$ is a polynomial in $K[X]$ with an infinite number of roots and therefore $f$ must be zero because it is a consequence of the division algorithm in $K[X]$ that a polynomial of degree $n$ has at most $n$ roots.
A: Over a $\rm\:\color{#c00}{domain}\ D,$ assume a polynomial $\rm\, f\in D[x]\,$ has more roots than its degree. We prove by induction on degree $\rm\,f\,$ that all coefficients of $\rm\,f\:$ are $\,0.\,$ If $\rm\,f\,$ has degree $\,0\,$ then $\rm\,f\,$ is constant, say $\rm\:f = c\in D.\,$ Since $\rm\,f\,$ has a root,  $\rm\,c = 0.\: $ Thus all coefficients of $\rm\,f\,$ are $\,0.\,$ Else $\rm\,f\,$ has degree $\ge 1,\:$ so $\rm\,f\,$ has a root $\rm\,r.\,$ By the Factor Theorem, $\rm\ f = (x\!-\!r) g,$ $\rm\: g\in D[x].\: $  Too $\rm\,g\,$  has more roots than its degree, since all roots $\rm\,s \ne r\,$ are roots of $\rm\,g\,$ by $\rm\,(s\!-\!r)g(s) = 0,\,$ $\rm\,s-r\ne 0\,$ $\Rightarrow$ $\rm\,g(s)=0,\:$ by $\rm\color{#C00}{domain}\ D.\:$ By induction, all coefficients of $\rm\,g\,$ are $\,0,\,$ so $\rm\,f = (x\!-\!r)g\: $ has all coefficients $0.\, \ $ QED
As a corollary, if $\rm\:\deg f < |D|\,$ and $\rm\,f(D) = 0,\,$ then all coefficients of $\rm\,f\,$ are $\rm\,0,\,$ i.e. if $\rm\,f\,$ is zero as a function, then it is zero as formal polynomial. In particular this is true for any infinite domain $\rm\,D,\,$ so the ring of polynomial functions over an infinite domain $\rm\,D\,$ is isomorphic to the ring $\rm\,D[x]\,$ of formal polynomials over $\rm\,D.$ 
The proof fails over non-domains, e.g. $\rm\,x^2\!-\!1 = (x\!-\!1)(x\!+\!1)\,$  has $\,4\,$ roots $\,\pm1,\pm3\,$ over $\: \mathbb Z/8 = $ integers $\rm\:mod\ 8.\:$ Notice how the proof breaks down due to the existence of zero-divisors: note that $\,3\,$ is a root by $\,2\cdot4\equiv 0,\,$ but $\,3\,$ is not a root of  $\rm\,x\!-\!1\,$ or $\rm\,x\!+\!1;\,$ i.e. $\rm\,x\!-\!3\,$ divides $\rm\,(x\!-\!1)(x\!+\!1)\,$ but doesn't divide either factor, so it is a non-prime irreducible. This yields the nonunique factorization $\rm\,(x-3)(x+3)\equiv (x-1)(x+1).$
