[proofplan]
We prove invariance by testing the one-step transition measure against an arbitrary measurable set $A \in \mathcal E$. Reversibility is applied with the first set equal to the whole state space $E$ and the second set equal to $A$. The Markov kernel normalization $P(x,E)=1$ then reduces the resulting integral over $A$ to $\pi(A)$.
[/proofplan]
[step:Apply detailed balance with the whole state space as one argument]
Fix an arbitrary set $A \in \mathcal E$. Since $P$ is a Markov kernel, the map
\begin{align*}
x \mapsto P(x,A)
\end{align*}
from $E$ to $[0,1]$ is $\mathcal E$-measurable, so the integral $\int_E P(x,A)\,d\pi(x)$ is well-defined.
Apply reversibility with the measurable sets $E$ and $A$. Since $E,A \in \mathcal E$, the detailed balance identity gives
\begin{align*}
\int_E P(x,A)\, d\pi(x) = \int_A P(x,E)\, d\pi(x).
\end{align*}
[guided]
We fix an arbitrary measurable set $A \in \mathcal E$ because invariance of $\pi$ must be proved set-by-set: the target identity is
\begin{align*}
\pi(A) = \int_E P(x,A)\, d\pi(x).
\end{align*}
The expression on the right is meaningful because $P$ is a Markov kernel. For each fixed $A \in \mathcal E$, the function
\begin{align*}
E &\to [0,1]
\end{align*}
\begin{align*}
x &\mapsto P(x,A)
\end{align*}
is $\mathcal E$-measurable. Since it is also bounded between $0$ and $1$, it is integrable with respect to the probability measure $\pi$.
Now we use the hypothesis that $P$ is reversible with respect to $\pi$. Reversibility says that for every pair of measurable sets $B,C \in \mathcal E$,
\begin{align*}
\int_B P(x,C)\, d\pi(x) = \int_C P(x,B)\, d\pi(x).
\end{align*}
We choose $B=E$ and $C=A$. Both are elements of $\mathcal E$, so the hypothesis applies and yields
\begin{align*}
\int_E P(x,A)\, d\pi(x) = \int_A P(x,E)\, d\pi(x).
\end{align*}
This is the key use of detailed balance: it turns the total incoming mass into $A$ into an integral over $A$ itself.
[/guided]
[/step]
[step:Use the Markov kernel normalization to identify the integral with $\pi(A)$]
Because $P$ is a Markov kernel, for every $x \in E$ the set function $B \mapsto P(x,B)$ is a probability measure on $(E,\mathcal E)$. Hence
\begin{align*}
P(x,E)=1
\end{align*}
for every $x \in E$. Therefore
\begin{align*}
\int_A P(x,E)\, d\pi(x) = \int_A 1\, d\pi(x).
\end{align*}
By the defining property of integration of the constant function $1$ over a measurable set,
\begin{align*}
\int_A 1\, d\pi(x) = \pi(A).
\end{align*}
Combining this identity with the detailed balance identity from the previous step gives
\begin{align*}
\int_E P(x,A)\, d\pi(x) = \pi(A).
\end{align*}
Since $A \in \mathcal E$ was arbitrary, this is exactly the invariance of $\pi$ for $P$.
[/step]