Let $R$ be a commutative ring with identity. Show that if there exists a monic polynomial $p(x)\in R[x]$ of degree $\geq 1$ such that the ideal $(p(x))\subset R[x]$ is maximal, then $R$ is a field.
My attempt: I understand that since $(p(x))$ is a maximal ideal, then $R[x]/(p(x))$ is a field. I also understand that $p(x)$ must be irreducible, else if $p(x)=g(x)h(x)$ then the ideal $(p(x))$ could not be maximal as it is contained in $(g(x))$.
Working with this, I want to show that for every element $x\in R$, there exists some $y$ such that $xy=1$. I'm thinking I can use a map from $R$ to $R[x]/(p(x))$ and somehow show that the product $xy$ gets mapped to the identity. I'm not at all sure about this though, is this a good direction?
Any help appreciated!