Let $R$ be a commutative ring. Let $P,Q$ be two ideals of $R$. Then I know that $PQ$, the product of ideals, is the ideal generated by $pq$ for each $p\in P$ and $q\in Q$. In other words,
\begin{equation} PQ = \{p_1q_1+p_2q_2+\cdots +p_iq_i:\text{for all $i$}\}. \end{equation}
But what can we say when $P=Q$? My thought is that since an ideal is closed additively, $P^2=P$, and in fact it must hold for all other powers. Is it true? If not, why does this property fail to hold?
$P^2\ne P$ in general. While $(0)^2=(0)$, consider $(X)\subset \mathbb{Z}[x]$, then $(X)^2=(X^2)\ne (X)$, in general $(X)^n=(X^n)$, which consists of all polynomials in one variable where every term has degree at least $n$.