Can a nonzero polynomial evaluate to the zero function in a suitable infinite ring of char 0?
Yes. I'll give my example first. Below is the TeXing I did while thinking that I was proving the answer to be "no". Trying to prove the answer was "no" led me to this example:
Let $R=\mathbb{Z}[y]/\langle 6y,y^2\rangle$. This commutative ring has characteristic zero, since no integer is in the ideal $\langle 6y,y^2\rangle$. And now you can just slide over your polynomial example so that it always evaluates to zero: $$f(X) = y\;X^3-y\;X=y\;(X^3-X)$$
Just as in your example, $X^3-X$ always evaluates to a multiple of $6$ when $X$ is an integer. More generally if $X=a+b\;y$, then since $y^2$ is modded out, we only need consider the constant term $a$.
If you changed the question to be about integral domains rather than characteristic zero rings, then the answer would be "no" by completing the argument below.
Suppose that $f$ is such a polynomial in $R[x]$ of degree $n$: $$f(x)=\sum_{j=0}^n\;c_j\;x^j$$ The equations $$f(i)=0$$ for $i=0\ldots n$ form a system of $n+1$ linear equations in the unknowns $\{c_j\}$. There is one clear solution to this system, where each $c_j=0$. But can there be other solutions with $c_j\in R$?
The system can be written as $$\begin{bmatrix}1 & 0 & 0 & \cdots & 0\\ 1 & 1 & 1 &\cdots & 1\\ 1 & 2 & 4 &\cdots & 2^n\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ 1 & n & n^2 & \cdots & n^n\end{bmatrix} \begin{bmatrix}c_0\\c_1\\c_2\\\vdots\\ c_n\end{bmatrix} =\begin{bmatrix}0\\0\\0\\\vdots\\0\end{bmatrix}$$
The matrix on the left (which I will call $V$) is an example of a Vandermonde matrix which is invertible in $M(\mathbb{Q})$. Now, $V$ might not have an inverse in $M(R)$, but that's not a big problem. It's still the case that in $M(R)$ there is a matrix $W$ such that $W\;V$ is a scalar matrix $D$ with an integer $d$ running down the diagonal. You just need to rescale $V^{-1}$ by the least common multiple of the divisors that appear in $V^{-1}$. After applying $W$ to both sides, $$D \begin{bmatrix}c_0\\c_1\\c_2\\\vdots\\ c_n\end{bmatrix} =\begin{bmatrix}0\\0\\0\\\vdots\\0\end{bmatrix}$$
So there is some nonzero integer $d$, such that for each $j$, we have that $d\cdot c_j=0$.
Here I realized the answer is actually "yes".
Consider the ring generated by $a$ with $a^2 = 0$, and take $p(x) = a x$.