I found this observation on my book, but I did not understand it well.
Let $R$ a commutative ring without identity, but having a single generator, then $R$ contains nonprime maximal ideal.
We suppose that $R=(a)$. First observe that the principal ideal $(a^2)$ is a proper ideal of $R$, since the generator $a\notin (a^2)$. Indeed, were $a$ in $(a^2)$, we could write $a=ra^2+na^2$ for same $r\in R$ and $n\in \mathbb{Z}$;
Why, in this case, the element $e=ra+na$ is a multiplicative identity for $R$? Therefore, since $e$ is a identity of $R$, they are violated the hypothesis.
Now, since $R\ne (a^2)$, exist a maximal ideal $M$ of $R$ with $(a^2)\subseteq M$. However $M$ is not a prime ideal, as can be seen by considering the product of elements in te complement of $M$ ($r,s\notin M$), the product $rs\in (a^2)\subseteq M$. (Why this is the negation of a definition of prime ideal?)
Anyone could explain to me how things are?
Thanks!
Since every element of $R$ can be written as $ra+na$ for some $r\in R$ and $n\in\mathbb{Z}$, if we find $e\in R$ such that $ae=a$, then $e$ will be the identity of $R$.
If $a\in(a^2)$, then $a=ra^2+na^2$, for some $r\in R$ and $n\in\mathbb{Z}$. Set $e=ra+na$; then $ae=a$.
Now take an ideal $M$ of $R$ maximal with respect to the property that
Such a maximal element exists by Zorn's lemma: the union of a chain of ideals containing $(a^2)$ and not containing $a$ is again an ideal satisfying the same property. Clearly such an ideal is not prime, because $a\notin M$, but $aa=a^2\in M$.
Let's prove that $M$ is maximal. If $I$ is an ideal of $R$ properly containing $M$, then $I$ contains $(a^2)$, so by the choice of $M$ we must have $a\in I$. Hence $I=R$.
Note: the fact that $R=(a)$ is crucial. A ring without an identity can fail to have maximal ideals at all.