prove that $R=e_1R\times e_2R\times\cdots\times e_nR$ I have troubles in showing this fact. Let $R$ be a ring, and assume that $e_1,\dots,e_n$ are central idempotents elements of $R$, i.e. idempotents contained in the center of $R$. Assume moreover that the following holds: $$\sum_{i=1}^n e_i=1.$$
Then prove that $$R=e_1R\times e_2R\times\cdots\times e_nR,$$
that is, the internal direct sum as an abelian group, in which the multiplication is defined componentwise.
Thanks in advance.
EDIT in the comments below the crucial points has been touched. Is it inessential that we assume $e_ie_j=0\quad \forall i\neq j$ or may this stronger hypothesis be recovered from the ones we are given in the text? (P.S. the problem lies in an handout my teacher gave to me and i've copied word by word)

There is a counterexample.
If $R= \mathbb{Z} /2 \mathbb{Z}$, and $e_1=e_2=e_3=\bar{1}$.
$e_1,e_2$ and $e_3$ are central idempotents.
$e_1+e_2+e_3=\bar{1}$.
$e_i R=R$ for all $i \in \{1,2,3\}$.
But $R \neq R \times R \times R$, because $R$ has 2 elements, and $R \times R \times R$ has $8$ elements.
