This question already has an answer here:
If $A$ is a finite product of fields, then $A[x]$ is a principal ideal ring. I think the converse also holds.
A principal ideal ring has dimension $\leq 1$ (see here, this is elementary). If $A[x]$ is a principal ideal ring, then $1 \geq \dim(A[x]) \geq \dim(A)+1$, hence $\dim(A)=0$. Besides, $A$ is a principal ideal ring (as a quotient of $A[x]$), in particular noetherian. It is well-known that then $A$ is artinian, and that $A$ is a finite product of local artinian rings. Passing to one of the factors, we may assume that $A$ is local artinian ring and have to show that $A$ is a field.
[… to be continued later, I have to go now]
Martin Brandenburg is right: for a commutative ring $A$, $A[t]$ is a principal ideal ring (henceforth a “principal ring”) iff $A$ is a finite product of fields.
In the following, all rings will be commutative.
Step 0: We make use of the following easy facts:
$\bullet$ A finite product of principal rings is a principal ring.
$\bullet$ For any rings $A_1$ and $A_2$, we have $(A_1 \times A_2)[t] \cong A_1[t] \times A_2[t]$.
$\bullet$ For any ideal $I$ in a ring $R$, $R[t]/IR[t] \cong (R/I)[t]$.
Step 1: If $A[t]$ is principal, so is $A$. By a theorem of Hungerford, $A$ is isomorphic to a finite product of rings $\prod_{i=1}^r A_i$, each of which is either a PID or a quotient of a PID. Then $A[t] \cong \prod_{i=1}^r A_i[t]$. Each $A_i[t]$ has dimension one more than the dimension of $A_i$, so if there is a PID factor then $A[t]$ has dimension $2$, contradiction. So we are left with the case of a finite product of quotients of a PID. By a Chinese Remainder Theorem argument we can further decompose this into a finite product of quotients of DVRs, and thus we reduce to the following local case:
Let $A$ be a DVR with uniformizer $\pi$. If for some $n \in \mathbb{Z}^+$ the ring $B = A/\langle \pi^n \rangle[t] \cong A[t]/\langle \pi^n \rangle$ is principal, then $n = 1$.
Step 2: Let’s assume $n > 1$. The evident thing to do here is try to show that the ideal (in $B$ naturally corresponding to) $I = \langle \pi ,t \rangle$ is not principal. This should be an elementary calculation. I decided to reduce myself to an easier calculation though: if $I$ were principal, then so would be its pushforward in the quotient ring $B’ = A[t]/\langle \pi,t \rangle^2$, and this calculation is truly easy: suppose $I = \langle p \rangle$. Then there are $x,y \in B’$ with $px = \pi$, $py = t$. We can write
$p = p_0 + p_1 t$, $x = x_0 + x_1 t$, $y = y_0 + y_1 t$ with $p_i,x_i,y_i \in A$. If you multiply everything out and consider the “valuations” of $p_i$, $x_i$, $y_i$ — here I use parentheses because I am working in a quotient with $\pi^2 = 0$, so one can think of every element as having valuation $0$, $1$ or $\geq 2$ — then you see in a few lines that this is not possible.
$\newcommand{\mm}{\mathfrak{m}}$
Added: Here is an approach to Step 2 that avoids any computation. Consider the maximal ideal $\mm = \langle \pi, t \rangle$ in $\tilde{B} = A[t]$. It obviously has height at least $2$, so by the Generalized Principal Ideal Theorem (GPIT) it is not principal (and in fact has height exactly $2$). Consider its image in the localization $C = \tilde{B}_\mm$: the height has not changed so it still requires $2$ generators. By Nakayama’s Lemma, the minimal number of generators of $\mm$ is equal to the minimal number of generators of $\mm/\mm^2$, so $\mm/\mm^2$ is indeed a nonprincipal ideal in $C/\mm^2 = B’$.
Comments: 1) Note that I ended up using a harder result than the one of Zariski-Samuel that a principal ring is a finite product of PIDs and Artinian principal rings. In particular, the result of Zarisk-Samuel is proved in my commutative algebra notes, but Hungerford’s Theorem is only stated: the proof uses the Cohen structure theory of complete local rings, which I do not treat. I expect this will turn out to be overkill.
2) If you only wanted to answer the title question, there are easier ways to go. Martin Brandenburg’s answer links to a webpage which gives a completely elementary proof that a principal ideal ring has dimension at most one. To my mind though the most natural proof of this is simply to apply Krull’s Principal Ideal Theorem, which implies that a prime ideal of height $n$ in a Noetherian ring requires at least $n$ generators.
3) If in the construction above we take our DVR $A$ to be $\mathbb{Z}_p$, then the ring $B’ = A[t]/\langle p,t \rangle^2$ is a nonprincipal ring of finite order $p^3$. This is minimal in the sense that a finite nonprincipal ring must have order divisible by the cube of some prime.
4) Note that a commutative ring is a finite product of fields iff it is a semisimple ring: every short exact sequence of $R$-modules splits. Is there a different proof which uses this fact?
The missing piece of Martin Brandenburg’s answer is the following:
Let $A$ be an artinian local ring such that $A[X]$ is a PIR. Then $A$ is a field.
Obviously $A$ is a PIR. Let $\mathfrak m=(a)$ be the maximal ideal of $A$. If $a=0$ we are done. Assume that $a\neq 0$. Since $A[X]$ is a PIR, the ideal $(a,X)$ of $A[X]$ is principal, that is, there exists $f\in A[X]$ such that $(a,X)=(f)$. Then $A[X]/(f)\simeq A/(a)$ is a field, so $f$ generates a maximal ideal. On the other side, $A[X]/(a)\simeq A[X]/\mathfrak m[X]\simeq (A/\mathfrak m)[X]$ is an integral domain, so $a$ generates a prime ideal in $A[X]$. Since $a\in(f)$ we get that $a=fv$, $v\in A[X]$. Then $fv\in (a)$ implies $f\in (a)$ or $v\in (a)$. If $f\in (a)$, then $f=ag$, $g\in A[X]$. Since $X\in (f)$ there exists $h\in A[X]$ such that $X=fh$. We get $X=agh$ and then, by identifying the coefficients, we obtain $1=ab$, for some $b\in A$, a contradiction. If $f\notin (a)$, then $v\in(a)$, that is, $v=av’$, and therefore $a=afv’$. It follows that $1-fv’$ is a zerodivisor of $A[X]$. But it’s easy to show that $J(A[X])=aA[X]$ and $Z(A[X])=aA[X]$ (here $J(A[X])$ stands for the Jacobson radical of $A[X]$ and $Z(A[X])$ for the set of zerodivisors of $A[X]$). Thus $1-fv’\in J(A[X])$. In particular, $1-(1-fv’)=fv’$ is an invertible element of $A[X]$, so $f$ is invertible, a contradiction.
Below is a more general characterization of PIRs. Note that the polynomial ring $\rm\:R[x]\:$ is the special case $\rm\:S \cong \Bbb N\:$ of the semigroup ring R[S] considered below. The Laurent polynomial ring $\rm\:R[x,x^{-1}]\:$ is the special case $\rm\:S\cong \Bbb Z.\:$ See this post for much more.
Theorem $\ \ $ TFAE for a semigroup ring R[S], with unitary ring R, and nonzero torsion-free cancellative monoid S.
$\rm(1)\ \ $ R[S] is a PIR (Principal Ideal Ring)
$\rm(2)\ \ $ R[S] is a general ZPI-ring (i.e. a Dedekind ring, see below)
$(3)\ \ $ R[S] is a multiplication ring (i.e. $\rm\ I \supset\ J \Rightarrow\ I\ |\ J\ $ for ideals $\rm\:I,J\,)$
$(4)\ \ $ R is a finite direct sum of fields, and $\rm\,S\,$ is isomorphic to $\,\mathbb Z\,$ or $\,\mathbb N\,$
A general ZPI-ring is a ring-theoretic analog of a Dedekind domain
i.e. a ring where every ideal is a finite product of prime ideals.
A unitary ring R is a general ZPI-ring $\iff$ R is a finite direct sum
of Dedekind domains and special primary rings (aka SPIR = special PIR)
i.e. local PIRs with nilpotent max ideals. ZPI comes from the German
phrase “Zerlegung in Primideale” = factorization in prime ideals.
The classical results on Dedekind domains were extended to rings
with zero divisors by S. Mori circa 1940, then later by K. Asano
and, more recently, by R. Gilmer. See Gilmer’s book “Commutative
Semigroup Rings” sections 18 (and section 13 for the domain case).
I guess the answers given clearly show that what I set out to show ($A[X]$ a principal ring implies $A$ a field) is false, and since the deduction of that conclusion from the proposition seems straightforward enough, the proposition must also be false. Indeed it is: by the first two points in Step 0 of Pete L. Clark, for any pair of fields $F,F’$ the ring $(F\times F’)[X]$ has a prime ideal $(F\times\{0\})[X]$ that is not maximal.
In particular, the ring $\def\Z{\mathbf Z}(\Z/10\Z)[X]$ is a principal ideal ring, while $\Z/10\Z$ is of course not a field. More generally $(\Z/n\Z)[X]$ provides a counterexample whenever $n$ is composite but square-free. To see explicitly that this is a principal ideal ring, reduce a given ideal $I\in(\Z/n\Z)[X]$ modulo every prime factor$~p$ of$~n$, find a minimal degree nonzero element as generator, or $0$ if the ideal collapses to $\{0\}$ modulo$~p$, then apply the Chinese remainder theorem separately for the coefficients of each $X^i$ to reconstruct a polynomial in $(\Z/n\Z)[X]$ that represents all those generator polynomials at once, which gives a generator of $I$.
So what about the proof (which I really believed in when I wrote it)? It is the innocent looking condition “nonzero” that was overlooked in the proof: the fact that $R_1\times\cdots\times I_k\times\cdots\times R_n$ is nonzero does not imply that $I_k$ nonzero. So there is no reduction to the same proposition for each of the factors, and the proof fails. In fact the proposition itself fails as soon as there is at least one PID factor and at least one other nontrivial factor in the product of rings.