Lemma: Let $A$ be a ring in which every element satisfies $x^n = x$ for some $n > 1$ (depending on $x$) then every prime ideal in $A$ is maximal.
Proof: Let $\mathfrak p$ be a prime ideal in $A$ and consider $A / \mathfrak p$.It follows that $A / \mathfrak p$ is an integral domain. Let $\overline 0 \neq \overline x \in A / \mathfrak p$. Since $x \in A$, by hypothesis there exists $n \geq 2$ such that $x^n = x$ or equivalently $x(x^{n - 1} - 1) = 0$. Observe that $\overline {x(x^{n - 1} - 1)} = \overline x \cdot \overline {x^{n - 1} - 1} = \overline 0$. Since $A / \mathfrak p$ is an integral domain, either $\overline x = \overline 0$ or $\overline {x^{n - 1} - 1} = \overline 0$. By assumption $\overline x \neq \overline 0$, so we must have $\overline {x^{n - 1} - 1} = \overline 0$, or equivalently $\overline {x^{n - 1}} = \overline 1$. But notice that $x^{n - 1} = x \cdot x^{n - 2}$ which means that $\overline x \cdot \overline {x^{n - 2}} = \overline 1$. Choose $\overline y = \overline {x^{n - 2}}$ gives us $\overline x \overline y = \overline 1$ which means that $A / \mathfrak p$ is a field. Hence we can conclude that $\mathfrak p$ is a maximal ideal.
Let $A$ be a ring such that $x^2 = x$ for all $x \in A$.
Claim: Every prime ideal $\mathfrak p$ is maximal, and $A / \mathfrak p$ is a field with two elements;
Proof: Let $\mathfrak p$ be a prime ideal in $A$. By the lemma, $\mathfrak p$ is maximal and hence $A / \mathfrak p$ is a field. Let $\overline x \in A / \mathfrak p$ if $\overline x = \overline 0$, then we're done, so suppose $\overline x \neq \overline 0$. Since $x^2 = x$, we have $x(x - 1) = 0$ which means $\overline x \cdot \overline{x - 1} = \overline 0$. Since $\overline x \neq \overline 0$, it must be that $\overline{x - 1} = \overline 0$ which means $\overline x = \overline 1$. Conclude that $A / \mathfrak p$ is the field consisting of only two elements: the zero element and the identity element.
The above proof shows you more than you need. Here would be a nice direct proof just showing that $A/ \mathfrak p$ has two elements:
Let $\mathfrak p$ be a prime ideal in $A$, hence $A / \mathfrak p$ is an integral domain. Let $\overline x \in A/ \mathfrak p$. If $ \overline x = 0$, then we're done, so suppose $\overline x \neq 0$. Since $x^2 = x$, we have $x(x - 1) = 0$ which means $\overline x \cdot \overline{x - 1} = \overline 0$. Since $\overline x \neq \overline 0$, it must be that $\overline{x - 1} = \overline 0$ which means $\overline x = \overline 1$. Conclude that $A / \mathfrak p$ consists of only two elements: the zero element and the identity element.