TITLE: Question about fields and quotients of polynomial rings
QUESTION [6 upvotes]: I don't see how to solve the following problem:

Let $R$ be a commutative and unitary ring. If there exists a monic polynomial $f(x) \in R[x]$ so that $R[x]/(f(x))$ is a field, show that $R$ is a field. What about if $f(x)$ isn't monic?

I don't have a clue about how proving it. I see that if $R$ is a field and $f(x)$ a monic and irreducible polynomial in $R[X]$ then $\frac{R[x]}{(f(x))}$ is a field, but that is not the question!
Thank you in advance for your help

REPLY [2 votes]: Let me try and clear up the confusion in the comments under DonAntonio's answer, and perhaps why the monic assumption is crucial.
Since $f$ is monic, $(f) \cap R = 0$. Thus the composition $R \to R[x] \to R[x]/(f)$ has kernel $(f) \cap R = 0$, i.e. is injective, so $R \hookrightarrow R[x]/(f)$ is a subring of a field, hence is a domain. Next, $f$ being monic says exactly that $R \hookrightarrow R[x]/(f)$ is an integral extension. Then $R$ is a domain with $\dim R = \dim R[x]/(f) = 0$, hence is a field.
As for an example where this fails if $f$ is not monic, consider $R = \mathbb{Z}_{(2)}$, $f = 2x - 1$. Then $R$ is not a field, but $R[x]/(f) = \mathbb{Z}_{(2)}[x]/(2x-1) \cong \mathbb{Z}_{(2)}[\frac{1}{2}] \cong \mathbb{Q}$ is a field (notice that this example is in much the same spirit as the one given by user26857: both are localizations at principal open sets which are fields).