$R$ a commutative ring of characteristic $n>0$. If there is a monic polynomial in $(\mathbb Z/n)[X]$ vanishing identically on $R$, then $\dim R=0$ Let $R$ be a commutative ring with unity of characteristic $n>0$. Then w.l.o.g., we may assume that $\mathbb Z/n \subseteq R$. If  there exists a monic polynomial $f(X) \in (\mathbb Z/n)[X]$ such that $f(r)=0,\forall r\in R$, then how to prove that $R$ is zero-dimensional i.e. every prime ideal of $R$ is maximal ?
 A: If $P$ is a prime ideal of $R$, then $P\cap (\mathbb{Z}/n\mathbb{Z})=p\mathbb{Z}/n\mathbb{Z}$ for some prime $p$ dividing $n$, and $\mathbb{Z}/p\mathbb{Z}\subseteq R/P$. Let $\bar{f}\in(\mathbb{Z}/p\mathbb{Z})[X]$ be the reduction of $f$. Then $\bar{f}(\bar{r})$ for every $\bar{r}\in R/P$. Since $f$ is monic, $\bar{f}$ is non-zero. Given that $(\mathbb{Z}/p\mathbb{Z})$ is a field, and every element of the domain $R/P$ is a root of $\bar{f}$, then $|R/P|$ is finite (bounded by the degree of $f$). Finally, it is well known that any finite domain is a field, so $P$ is maximal, as we wanted to see. 
A: The existence of $f(X)$ guarantees that every element in $R$ is integral over $\mathbb{Z}/(n)$. In other words, $\mathbb{Z}/(n) \subset R$ is an integral extension. So, $\dim R = \dim \mathbb{Z}/(n) = 0$.
A: Unless I've made a mistake, here is a partial generalization . . .

Let $R$ be a commutative ring with $1\ne 0$ such that


*

*$2$ is a unit of $R$.

*For some monic $f\in R[x]$, we have $f(r)=0$, for all $r\in R$.


Claim:$\;R$ has Krull dimension $0$.

Proof:

Suppose $P$ is a prime ideal of $R$ which is not maximal.

Our goal is to derive a contradiction.

Let $M$ be a maximal ideal of $R$ such that $P\subset M$.

Write $f(x) = x^d +{\displaystyle{\sum_{i=0}^{d-1}a_ix^i}}$, where $a_i\in R$, for $0 \le i \le d-1$.

From $f(0)=0$, we get $a_0=0$.

From $f(1)=0$, it follows that $d > 1$, and least one of $a_1,...,a_{d-1}$ is not in $P$.

Let $k$ be the least positive integer such that $a_k\notin P$.

Let $w$ be an arbitrary element of $M{\setminus}P$.
\begin{align*}
\text{Then}\;\;&f(w)=0\\[4pt]
\implies\;&w^d +\sum_{i=0}^{d-1}a_iw^i=0\\[4pt]
\implies\;&w^d +\sum_{i=0}^{d-1}a_iw^i\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^d +\sum_{i=k}^{d-1}a_iw^i\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^k\left(w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\right)\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\equiv 0\;(\text{mod}\;P)&&\text{[since $w\notin P$]}\tag{1}\\[4pt]
\implies\;&w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\equiv 0\;(\text{mod}\;M)\\[4pt]
\implies\;&a_k\equiv 0\;(\text{mod}\;M)\\[4pt]
\implies\;&a_k\in M{\setminus}P\\[4pt]
\implies\;&a_k^{d-k} +\sum_{i=k}^{d-1}a_ia_k^{i-k}\equiv 0\;(\text{mod}\;P)&&\text{[using $w=a_k$ in $(1)$]}\\[4pt]
\implies\;&a_k^{d-k} +a_k\left(\sum_{i=k+1}^{d-1}a_ia_k^{i-k-1}+1\right)\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&a_k^{d-k-1} +\sum_{i=k+1}^{d-1}a_ia_k^{i-k-1}+1\equiv 0\;(\text{mod}\;P)&&\text{[since $a_k\notin P$]}\\[4pt]
\implies\;&a_k^{d-k-1} +\sum_{i=k+1}^{d-1}a_ia_k^{i-k-1}+1\equiv 0\;(\text{mod}\;M)\\[4pt]
\implies\;&
\begin{cases}
1\equiv 0\;(\text{mod}\;M)\qquad\text{if $k < d-1$}\\[4pt]
2\equiv 0\;(\text{mod}\;M)\qquad\text{if $k = d-1$}\\
\end{cases}
\\[4pt]
\end{align*}
contradiction.
A: Let $R$ be a commutative ring with $1\ne 0$ such that


*

*$R$ contains a subring $R_0$ of Krull dimension $0$.$\\[4pt]$

*For some monic $f\in R_0[x]$, we have $f(r)=0$, for all $r\in R$.


Claim:$\;R$ has Krull dimension $0$.

Proof:

Suppose $P$ is a prime ideal of $R$ which is not maximal.

Our goal is to derive a contradiction.

Let $M$ be a maximal ideal of $R$ such that $P\subset M$.

Let $P'=P\cap R_0$, and let $M'=M\cap R_0$.

Then $P',M'$ are prime ideals of $R_0$, and since $P\subset M$, we get $P'\subseteq M'$.

But then, since $R_0$ has Krull dimension $0$, it follows that $P'=M'$.

Write $f(x) = x^d +{\displaystyle{\sum_{i=0}^{d-1}a_ix^i}}$, where $a_i\in R_0$, for $0 \le i \le d-1$.

From $f(0)=0$, we get $a_0=0$.

From $f(1)=0$, it follows that $d > 1$, and least one of $a_1,...,a_{d-1}$ is not in $P$.

Let $k$ be the least positive integer such that $a_k\notin P$.

Let $w\in M{\setminus}P$.
\begin{align*}
\text{Then}\;\;&f(w)=0\\[4pt]
\implies\;&w^d +\sum_{i=0}^{d-1}a_iw^i=0\\[4pt]
\implies\;&w^d +\sum_{i=0}^{d-1}a_iw^i\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^d +\sum_{i=k}^{d-1}a_iw^i\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^k\left(w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\right)\equiv 0\;(\text{mod}\;P)\\[4pt]
\implies\;&w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\equiv 0\;(\text{mod}\;P)&&\text{[since $w\notin P$]}\\[4pt]
\implies\;&w^{d-k} +\sum_{i=k}^{d-1}a_iw^{i-k}\equiv 0\;(\text{mod}\;M)\\[4pt]
\implies\;&a_k\equiv 0\;(\text{mod}\;M)\\[4pt]
\implies\;&a_k\in M{\setminus}P\\[4pt]
\implies\;&a_k\in M'{\setminus}P'&&\text{[since $a_k\in R_0$]}\\[4pt]
\implies\;&P'\ne M'\\[4pt]
\end{align*}
contradiction.

Note:$\;$The special case $R_0=\mathbb{Z}{/}n\mathbb{Z}$ resolves the stated question.
