TITLE: A finite dimensional commutative algebra is a finite product of commutative local algebras
QUESTION [12 upvotes]: A finite dimensional commutative algebra is
a finite product of commutative local algebras. Why? In fact, every commutative semiperfect ring is a basic ring and isomorphic to a finite product of local rings, but I do not how to prove it.

REPLY [12 votes]: A slightly different proof than that of rschwieb. Let $R$ be a finite dimensional commutative artinian algebra. 

$R$ has only finitely many maximal ideals. Let $n$ be the dimension of $R$. If $m_1, \dots, m_r$ are distinct maximal ideals of $R$, then by Chinese Remainder Theorem, the canonical map
$$ R\to R/m_1\oplus \cdots \oplus R/m_r$$ 
is surjective. This imples implies that $r\le n$. So $R$ has only finitely many maximal ideals. Let $m_1, \dots, m_q$ be the maximal ideals of $R$. 
For some $N\ge 1$, $(m_1m_2\dots m_q)^N=0$.  The decreasing sequence of ideals $(m_1m_2\dots m_q)^N$ is stationary. For some $N\ge 1$, we have 
$$ (m_1m_2\dots m_q)^N=(m_1m_2\dots m_q).(m_1m_2\dots m_q)^N.$$
By Nakayama's lemma, this implies that $(m_1m_2\dots m_q)^N=0$. 
End of proof. Let $N$ be as above. Again by CRT, we have 
$$ R\simeq \oplus_{1\le i\le q} R/m_i^N.$$ 
Now $R/m_i^N$ is local because its only maximal ideal is the image of $m_i$ in $R/m_i^N$. 

Remark. The same proof works similarly if $R$ is not an algebra over a field, but has finite length.