# If spectrum of a commutative ring is empty

I have found this proposition: "If the spectrum of a commutative ring A is empty then A is the zero ring". By absurdum, if A is not the zero ring, there exists in A an element $$x\ne0$$. By Zorn's lemma, there exists a maximal ideal M such that $$x\notin M$$. If A has not a unit, M is not necessarily a prime ideal... So I have no idea to complete the proof. May you help me with some hint? Thank You.

$$A$$ has a unit in this context. This is necessary both to claim the existence of a maximal ideal using Zorn's lemma and to claim that a maximal ideal is prime.
The example Wikipedia provides, is the ring whose underlying additive group is $$\mathbf Q$$ with the usual addition and whose multiplication is $$a \cdot b = 0$$ for all $$a, b$$. A subset $$A \subseteq \mathbf Q$$ is an ideal if and only if it is an additive subgroup of $$\mathbf{Q}$$.
It is clear that no proper ideal can be prime since if $$x \notin A$$ then $$x^2 = 0 \in A$$.
Also, if $$A$$ is proper then $$(\mathbf{Q}/A,+)$$ is a non-zero divisible group, which means it has a non-zero proper subgroup, which by correspondence means there is a larger proper ideal than $$A$$. So no proper ideals of $$\mathbf{Q}$$ are maximal.
Indeed, the statement is false for rings without identity: $$2\mathbb Z/4\mathbb Z$$ has no prime ideals.