Let $R$ be commutative ring $R$ with a multiplicative identity $1$. Suppose
$p(x)=a_{n}x^{n}+\cdots a_{1}x+a_{0} $
is a polynomial in $R[x]$.
Prove that each $a_0,a_{1},\dots,a_n$ is a nilpotent element in $R$ if and only if $p(x)$ is nilpotent in $R[x]$.
Here is my attempt at the forward direction.
$(\Rightarrow)$ Suppose each $a_0,a_{1},\dots,a_n$ is nilpotent in $R$. Then $a_{i}^{n_{i}}=0$ for each $a_{i}$ and for some positive integer $n_{i}$. Let $N=\prod\limits_{i=0}^{n}n_{i}$. Then $[p(x)]^{N}=0$ which shows that $p(x)$ is nilpotent in $R[x]$.
I think this is correct, but I'm not positive. I couldn't find any concrete examples of a polynomial ring which contains more than one nilpotent element.
For the $(\Leftarrow)$ direction, I was thinking that I should use induction on the degree of $p(x)$. If this is the wrong approach, then I could use some advice on how to prove this.