Let $R$ be a commutative ring with $1$.
Out of curiosity, I wonder what is the state of art about $I_R=\{P\in R[X]\mid P(r)=0 \mbox{ for all }r\in R\}$.
This an ideal of $R[X]$, which can be rewritten as $I_R=\displaystyle\bigcap_{r\in R}(X-r)R[X]$.
What I know is that $I_R=(0)$ if $R$ is an infinite integral domain, and obviously nonzero if $R$ is finite.
There are several questions which came into my mind.
Questions.
a. Is there a nice way to characterize rings $R$ such that $I_R\neq (0)$?
b. As a related subquestion, can we characterize rings $R$ such that every nonzero polynomial has finitely many roots in $R$ ?
Is $I_R$ a principal ideal ?
When $I_R\neq (0)$, what can we say about the minimal degree of a nonzero element of $I_R$ , especially when $R$ is finite ? Does all degrees $d\geq 2$ can happen?
Some thoughts. First of all, I'm not sure Question 1. will have a simple answer. If $R$ is infinite, one may have both cases happening: if $R$ is an infinite integral domain, then $I_R=(0)$, while if $R=\mathbb{F}_2^{\mathbb{N}}$, $I_R$ contains $X^2-X$ (and I'm pretty confident that $I_R=(X^2-X)$ in this case).
Concerning the computation of $I_R$, one may observe the following. Assume $char(R)=c>0$, and let $p$ be the smallest prime divisor of $c$. Let $f_R=\displaystyle\prod_{i=0}^{p-1}(X-i\cdot 1_R)$.
It is easy to check that the ideals $(X-i\cdot 1_R)R[X], 0\leq i\leq p-1$ are pairwise comaximal, so any element of $I_R$ is a multiple of $f_R$. Since $f_R$ is monic, any nonzero $P\in I_R$ has degree $\geq p$.
Note that if $R=\mathbb{F}_{q}$ where $q=p^r$, we have $I_R=(X^q-X)R[X]$, so the minimal degree can be $>p$ if $r>1$. However, there are some cases where the minimal degree is exactly $p$
For example, if $R=\mathbb{Z}/4\mathbb{Z}$, $\bar{2}X(X-\bar{1})\in I_R$. More generally, if $R=\mathbb{Z}/n\mathbb{Z}$, and $p$ is the smallest prime divisor of $n$, $\overline{n/p}f_R\in I_R$.
I have not thought about Question 2. seriously, but it would surprised if the answer would be Yes. A potential counterexample would probably be $R=\mathbb{Z}/4\mathbb{Z}$ ( since both $\bar{2}X(X-\bar{1})$ and $X(X-\bar{1}) (X-\bar{2})(X-\bar{3})$ lie in $I_R$, it is doubtful that $I_R$ is principal) but I have not worked it out yet.
Edit. In fact, if $R=\mathbb{Z}/4\mathbb{Z}$, we have $I_R=\Bigl(\bar{2}X(X-\bar{1}),X(X-\bar{1}) (X-\bar{2})(X-\bar{3})\Bigr)$. I'm quite sure that this ideal is not principal, but i've not found a convincing argument yet.
Edit 2. The ideal above is indeed not principal.
Any insight on any of these questions would be nice.
Nice question! This isn't a complete answer to Q1 but I answer Q3 below (all degrees occur). All rings below are commutative.
Let's call a polynomial $f(x) \in R[x]$ vanishing if it lies in $I_R$ and let's call $R$ vanishable if $I_R \neq 0$, and write $(x)_n = x(x-1) \dots (x-(n-1)))$ for the falling factorial. Some observations:
This last observation about nilpotents can be used to produce examples of $R$ such that the minimal degree of a (nonzero) polynomial in $I_R$ is an arbitrary positive integer $\ge 2$, which answers Q3. Consider the ring
$$R = \mathbb{F}_q[\epsilon_1, \epsilon_2, \dots ]/(\epsilon_1, \epsilon_2, \dots )^d$$
obtained by adjoining countably many nilpotents of order $d$ to $\mathbb{F}_q$ and then further declaring that all monomials in the $\epsilon_i$ of degree $d$ also vanish; this implies in particular that all sums of products of the $\epsilon_i$ are nilpotent of order $\le d$.
Proof. Begin by writing any $g_0(x) \in I_R$ as $g_0(x) = (x^q - x) g_1(x)$. Every element $x \in R$ can be written uniquely in the form $x = r + \epsilon$ where $r \in \mathbb{F}_q$ and $\epsilon$ is nilpotent. If $p(x) = x^q - x$ then this gives
$$p(r + \epsilon) = p(r) + p(\epsilon) = \epsilon(-1 + \epsilon^{q-1})$$
and hence $g_0(r + \epsilon) = 0$ for all nilpotent $\epsilon$ means (using that $-1 + \epsilon^{q-1}$ is a unit) that $\epsilon g_1(r + \epsilon) = 0$ for all $r \in \mathbb{F}_q$ and all nilpotent $\epsilon$. Working $\bmod \epsilon^2$ (here I might need to assume that $\epsilon$ is one of the $\epsilon_k$ but this is fine) this gives that $g_1(r) = 0 \bmod \epsilon$, and taking $\epsilon$ to be some $\epsilon_k$ which does not occur in the coefficients of $g_1$ (this is where we need countably many nilpotents) gives that in fact $g_1(r) = 0$ for all $r \in \mathbb{F}_q$, hence $g_1(x) = (x^q - x) g_2(x)$ for some polynomial $g_2(x)$.
Now the same argument as before gives that $\epsilon^2 g_2(r + \epsilon) = 0$ for all $r \in \mathbb{F}_q$ and all nilpotent $\epsilon$, and as before working $\bmod \epsilon^3$ (as long as $d \le 3$) gives $g_2(r) = 0 \bmod \epsilon$ for all nilpotents $\epsilon$ and hence $g_2(r) = 0$ for all $r \in \mathbb{F}_q$. Continuing in this way we find that
$$g_0(x) = (x^q - x)^d g_d(x)$$
which is necessary and sufficient for $g_0(x) \in I_R$ since every nilpotent has order $\le d$. $\Box$
What this example and others like the infinite products suggest is that non-Noetherian examples can be wacky but that the Noetherian case (or something like that) ought to be easier to characterize.