Finite commutative ring with more than $\frac{2}{3}$ of its elements idempotent 
Suppose that $R$ is a finite commutative ring with identity element, such that more than $\frac{2}{3}$ of elements are idempotent. Prove that all of elements are idempotent.

Please give me a hint. Thanks.
 A: Finite commutative rings are artinian, so they are isomorphic to a finite direct product of artinian local rings. Thus $R\simeq R_1\times\cdots\times R_n$ with $R_i$ artinian local rings. But local rings have only trivial idempotents, so $|\operatorname{Idemp}(R_i)|=2$. This shows $|\operatorname{Idemp}(R)|=2^n$. On the other side, $|R|=|R_1|\cdots|R_n|$. We know that $|\operatorname{Idemp}(R)|>\dfrac 23|R|$, so $3\cdot 2^{n-1}>|R|$. Moreover, $|R_i|\ge2$ for all $i=1,\dots,n$, and whether $|R_i|\ge3$ for some $i$ we get $3\cdot 2^{n-1}>3\cdot 2^{n-1}$, a contradiction. Conclusion: $|R_i|=2$ for all $i=1,\dots,n$, and therefore $R\simeq\mathbb F_2^n$.
Edit. If we assume "only" $|\operatorname{Idemp}(R)|\ge\dfrac 23|R|$ then the claim is wrong: set $R=\mathbb F_3$.
A: Let $A$ be the set of idempotent elements and $Z=A\cap (-1+A)$.
Then $$\tag1|Z|\ge 2|A|-|R|>\frac13|R|.$$
For $a\in Z$ we have $a,a+1\in A$, hence $$\tag22a=(a+1)^2-a^2-1=a+1-a-1=0$$
Lemma 1. $A+Z\subseteq A$.
Proof.
If $a\in Z$ and $b\in A$ then using $(2)$
$$(a+b)^2=a^2+2ab+b^2=a+0b+b=a+b $$
so $a+b\in A$. $_\square$
Lemma 2. $Z$ is an (additive) subgroup  of $R$ of index $\le 2$. 
Proof.
 If $a,b\in Z$, we have $b,b+1\in A$, hence by lemma 1 both $a+b\in A$ and $a+b+1\in A$,  i.e., $a+b\in Z$. 
This shows that $Z$ is closed under addition.
As $Z\ne\emptyset$ by $(1)$ and $R$ is finite, we have that $Z$ is a subgroup of $R$. The claim about the index is immediate from $(1)$. $_\square$
Remark: This is where we use the $>\frac23$. With any weaker estimate, even with $|A|\ge \frac23|R|$, we could not dismiss the case $[R:Z]=3$ so easily.
Lemma 3.
$A$ is an additive subgroup of $R$.
Proof.
If $a,b\in A$, we either have


*

*$b\in Z$. Then $a+b\in A+Z\subseteq A$ by lemma 1.

*$a\in Z$. Then $a+b\in Z+A\subseteq A$ as well

*$a,b\notin Z$. Then $a+b\in Z$ because by lemma 2 we have $(a+Z)+(b+Z)=Z$ in the quotient group $R/Z$.


Since $A$ is not empty and $R$ still finite, this completes the proof.
$_\square$
Finally, the index of $A$ in $R$ is $[R:A]=\frac{|R|}{|A|}<\frac32$, so must be $1$, i.e.
$$ A=R.$$
A: For any idempotent $a$ we have that $(1+a)^2=(1+a)+2a$, hence $1+a$ is not idempotent unless $2a=0$.
I claim that $2=0$ in $R$. Suppose not. Let $A$ be the set of idempotent elements; then $1+A$ has the same number of elements as $A$. The intersection of $A$ and $1+A$ has at least $2|A|-|R|$ elements; thus there are at least $2|A|-|R|$ idempotents $a$ such that $1+a$ is idempotent, hence $2a=0$. Call the set of such elements $Z$. For $a\in Z$, since $2\neq 0$ and $2a=0$ we have that $2(1+a)=2\neq 0$. Thus $(1+Z)\cap Z=\emptyset$, and since $Z,1+Z\subseteq A$ we have that $|A|\geq 4|A|-2|R|=|A|+(3|A|-2|R|)>|A|$, which is a contradiction.
Since $2=0$, for any elements $a,b$ such that $a$ is idempotent and $b$ is not idempotent we have that $(a+b)^2=a+b^2\neq a+b$. Can you finish?
