Question about fields and quotients of polynomial rings

Let $R$ be a commutative unitary ring. If there exists a monic polynomial $f\in R[X]$ so that $R[X]/(f)$ is a field, then $R$ is a field.

Let's first remark that the degree of non-zero polynomials in the ideal $(f)$ is at least $\deg f$. Now let $a\in R$, $a\ne 0$. We want to prove that $a$ is invertible in $R$. The residue class of $a$ in $R[X]/(f)$, denoted in what follows by $\hat a$, is not zero: if $\hat a=\hat 0$, then $a\in(f)$ and since $0=\deg a<\deg f$ we get a contradiction. Since $R[X]/(f)$ is a field it follows that $\hat a$ is invertible in $R[X]/(f)$, so there is $g\in R[X]$ such that $\hat a\hat g=\hat 1$, that is, $ag-1\in(f)$. Now write $g=fq+r$ with $\deg r<\deg f$. Then $ag-1=a(fq+r)-1=afq+ar-1\in (f)$, so $ar-1\in (f)$. But $\deg ar\le\deg r<\deg f$, and therefore we get $ar=1$. In particular, $ar_0=1$ for some $r_0\in R$. (Of course, $r_0$ is $r(0)$.)

What about if $f$ isn't monic?

Then the result is false: take $R=\mathbb Z/6\mathbb Z$, and $f=2X-1$. We have $R[X]/(f)\simeq S^{-1}(\mathbb Z/6\mathbb Z)$, where $S=\{1, 2, 4\}$, and $S^{-1}(\mathbb Z/6\mathbb Z)\simeq \mathbb Z/3\mathbb Z$ which is a field.


Hints:

In any case, we can write the elements of $\;R[x]/I\;,\;\;I:=\langle f(x)\rangle\;$ , as $\;g(x)+I\;,\;\;\deg g<\deg f\;$ , so assuming $\;\deg f\ge 1\;$ ,we have that the elements $\;r+I\in R[x]/I\;,\;\;0\neq r\in R\;$ are part of a field and since $\;r+I\neq \overline 0=I\;$ , then they all have multiplicative inverse ...

Added on the OP's request: The above hints us to look for a possible embedding $\;R\to R[x]/I\;,\;\;r\mapsto r+I$ (for this I need the assumption that $\;R\;$ is an ID):

$$\forall\,r,s\in R\;,\;\;r+I=s+I\iff r-s\in I\;$$

yet every element in $\;I\;$ is either zero of degree $\;\ge\deg f\;$ (here the assumption kicks in), and thus $\;r-s=0\iff r=s\;$ and we get our embedding.

Now,

$$0\neq r+I\in R/I\implies \exists\,s\in R\;\;s.t.\;\;(rs)+I=1+I\iff rs-1\in I$$

and again, as above, $\;rs=1\;$ and every non-zero element in $\;R\;$ has a multiplicative inverse.

Now, without the assumption of ID: as hinted in one of my comments below, we have that from $\;R\;$ is not a field it follows that $\;I\;$ cannot be a maximal ideal and thus the quotient ring isn't a field.

I'm not sure how, and if possible at all, to get rid of the above assumption of ID to make that approach work. If we get lucky, it could possibly be that the user that commented below and chose not to write down an answer/hint/input but rather just to question this answer will now grant us the honour to write down an answer/comment enlightening us all.


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).