Proof.

Suppose that the ideal $\frakp$ is reducible. Then there exist ideals $I_1$ and $I_2$ such that
\[\frakp=I_1 \cap I_2, \text{ and } \frakp \subsetneq I_1, \frakp \subsetneq I_2.\]

Since $I_1, I_2$ are strictly larger than $\frakp$, there exists $a\in I_1\setminus \frakp$ and $b\in I_2 \setminus \frakp$.
Then the product $ab\in I_1$ since $a$ is in the ideal $I_1$. Also $ab \in I_2$ since $b$ is in the ideal $I_2$.
Therefore $ab\in I_1 \cap I_2=\frakp$.

Since $\frakp$ is a prime ideal and $ab \in \frakp$, either $a\in \frakp$ or $b \in \frakp$ but this contradicts with the choice of elements $a$ and $b$.
Hence $\frakp$ is irreducible.

More from my site

Equivalent Conditions For a Prime Ideal in a Commutative Ring
Let $R$ be a commutative ring and let $P$ be an ideal of $R$. Prove that the following statements are equivalent:
(a) The ideal $P$ is a prime ideal.
(b) For any two ideals $I$ and $J$, if $IJ \subset P$ then we have either $I \subset P$ or $J \subset P$.
Proof. […]

A Prime Ideal in the Ring $\Z[\sqrt{10}]$
Consider the ring
\[\Z[\sqrt{10}]=\{a+b\sqrt{10} \mid a, b \in \Z\}\]
and its ideal
\[P=(2, \sqrt{10})=\{a+b\sqrt{10} \mid a, b \in \Z, 2|a\}.\]
Show that $p$ is a prime ideal of the ring $\Z[\sqrt{10}]$.
Definition of a prime ideal.
An ideal $P$ of a ring $R$ is […]

Nilpotent Element a in a Ring and Unit Element $1-ab$
Let $R$ be a commutative ring with $1 \neq 0$.
An element $a\in R$ is called nilpotent if $a^n=0$ for some positive integer $n$.
Then prove that if $a$ is a nilpotent element of $R$, then $1-ab$ is a unit for all $b \in R$.
We give two proofs.
Proof 1.
Since $a$ […]

Characteristic of an Integral Domain is 0 or a Prime Number
Let $R$ be a commutative ring with $1$. Show that if $R$ is an integral domain, then the characteristic of $R$ is either $0$ or a prime number $p$.
Definition of the characteristic of a ring.
The characteristic of a commutative ring $R$ with $1$ is defined as […]

In a Principal Ideal Domain (PID), a Prime Ideal is a Maximal Ideal
Let $R$ be a principal ideal domain (PID) and let $P$ be a nonzero prime ideal in $R$.
Show that $P$ is a maximal ideal in $R$.
Definition
A commutative ring $R$ is a principal ideal domain (PID) if $R$ is a domain and any ideal $I$ is generated by a single element […]