Let $R$ be a commutative ring with $1$ such that $R[x]$ is a principal ideal domain. Prove $R$ is a field.
So I thought to take $a\in R$ and look at $aR[x]$ which is a principal ideal and obviously $a\in R[x]$ is a polynomial of degree $0$ so $\langle a\rangle=aR[x]$.
I don't have a clue how to continue. I wanted to somehow show that $a^{-1}\in R$ and so every element is invertible (because we took a random one) so $R$ is a field. But I can't seem to find a way to prove that $a^{-1}\in R$. Any ideas?