[proofplan]
We prove two claims: (1) recurrence/transience is uniform within a communicating class, and (2) every recurrent class is closed. For (1), given communicating states $i \leftrightarrow j$, the [Chapman-Kolmogorov Equations](/theorems/2207) yield the sandwich inequality $p_{ii}(m + k + \ell) \geq \alpha \beta\, p_{jj}(k)$ where $\alpha = p_{ij}(m) > 0$ and $\beta = p_{ji}(\ell) > 0$. Summing over $k$ shows that divergence of $\sum_k p_{jj}(k)$ forces divergence of $\sum_r p_{ii}(r)$, transferring recurrence from $j$ to $i$. For (2), we argue by contradiction: if a recurrent class were not closed, the chain could escape and never return, contradicting the return probability being $1$.
[/proofplan]
[step:Establish the sandwich inequality $p_{ii}(m + k + \ell) \geq \alpha\beta\, p_{jj}(k)$ using Chapman-Kolmogorov]
Let $i \leftrightarrow j$ with $i \neqeq j$. Since $i \to j$, there exists $m \geq 1$ with $p_{ij}(m) > 0$; set $\alpha := p_{ij}(m)$. Since $j \to i$, there exists $\ell \geq 1$ with $p_{ji}(\ell) > 0$; set $\beta := p_{ji}(\ell)$. For any $k \geq 0$, applying the [Chapman-Kolmogorov Equations](/theorems/2207) twice:
\begin{align*}
p_{ii}(m + k + \ell) = \sum_{r \in S} \sum_{q \in S} p_{ir}(m)\, p_{rq}(k)\, p_{qi}(\ell) \geq p_{ij}(m)\, p_{jj}(k)\, p_{ji}(\ell) = \alpha\beta\, p_{jj}(k),
\end{align*}
where the inequality holds because we retain only the single term $r = j$, $q = j$ from the non-negative double sum.
[guided]
We need to relate the return probabilities of $i$ to those of $j$. The idea is to "route" a return to $i$ through $j$: go from $i$ to $j$ in $m$ steps, stay at $j$ for $k$ steps (returning to $j$), then go from $j$ back to $i$ in $\ell$ steps.
Since $i \leftrightarrow j$, there exist integers $m, \ell \geq 1$ with $p_{ij}(m) =: \alpha > 0$ and $p_{ji}(\ell) =: \beta > 0$. For any $k \geq 0$, the [Chapman-Kolmogorov Equations](/theorems/2207) give
\begin{align*}
p_{ii}(m + k + \ell) = \sum_{r, q \in S} p_{ir}(m)\, p_{rq}(k)\, p_{qi}(\ell).
\end{align*}
Every term in this sum is non-negative (each factor is a transition probability). Retaining only the term with $r = q = j$:
\begin{align*}
p_{ii}(m + k + \ell) \geq p_{ij}(m)\, p_{jj}(k)\, p_{ji}(\ell) = \alpha\beta\, p_{jj}(k).
\end{align*}
This is the key sandwich inequality: it bounds each return probability $p_{ii}$ (at time $m + k + \ell$) from below by a fixed positive constant $\alpha\beta$ times $p_{jj}(k)$.
[/guided]
[/step]
[step:Sum over $k$ to transfer recurrence between communicating states]
Summing the inequality $p_{ii}(m + k + \ell) \geq \alpha\beta\, p_{jj}(k)$ over $k = 0, 1, 2, \ldots$:
\begin{align*}
\sum_{k=0}^{\infty} p_{ii}(m + k + \ell) \geq \alpha\beta \sum_{k=0}^{\infty} p_{jj}(k).
\end{align*}
The left side is a sub-sum of $\sum_{n=0}^{\infty} p_{ii}(n)$ (indexing by $n = m + k + \ell$ as $k$ ranges over $\mathbb{N}_0$, with $m + \ell$ fixed). Therefore $\sum_{n=0}^{\infty} p_{ii}(n) \geq \alpha\beta \sum_{k=0}^{\infty} p_{jj}(k)$.
By the [Recurrence Summability Criterion](/theorems/2211), $j$ is recurrent iff $\sum_k p_{jj}(k) = \infty$. If $j$ is recurrent, the right side is $+\infty$, forcing $\sum_n p_{ii}(n) = \infty$, so $i$ is recurrent.
The argument is symmetric in $i$ and $j$: interchanging the roles of $i$ and $j$ (using $p_{ji}(\ell) > 0$ and $p_{ij}(m) > 0$) gives the reverse sandwich $p_{jj}(\ell + k + m) \geq \beta\alpha\, p_{ii}(k)$, so $i$ recurrent implies $j$ recurrent.
Therefore $i$ and $j$ agree in their classification as recurrent or transient.
[guided]
The inequality $p_{ii}(m+k+\ell) \geq \alpha\beta\, p_{jj}(k)$ holds for every $k \geq 0$, so we sum both sides over $k$:
\begin{align*}
\sum_{k=0}^{\infty} p_{ii}(m + k + \ell) \geq \alpha\beta \sum_{k=0}^{\infty} p_{jj}(k).
\end{align*}
The left side is $\sum_{n \geq m+\ell} p_{ii}(n)$, which is at most $\sum_{n \geq 0} p_{ii}(n)$ (we are only missing finitely many non-negative terms). So $\sum_{n=0}^{\infty} p_{ii}(n) \geq \alpha\beta \sum_{k=0}^{\infty} p_{jj}(k)$.
Now suppose $j$ is recurrent. By the [Recurrence Summability Criterion](/theorems/2211), $\sum_k p_{jj}(k) = \infty$. Since $\alpha\beta > 0$, the right side is $+\infty$, forcing $\sum_n p_{ii}(n) = \infty$, which means $i$ is recurrent (again by the [Recurrence Summability Criterion](/theorems/2211)).
For the converse, suppose $i$ is recurrent. By symmetry of communication ($i \leftrightarrow j$ implies $j \leftrightarrow i$), we can run the same argument with $i$ and $j$ swapped: there exist $\ell' \geq 1$ with $p_{ji}(\ell') > 0$ and $m' \geq 1$ with $p_{ij}(m') > 0$ (these are the same $\ell$ and $m$ from before, just relabelled). The sandwich inequality becomes $p_{jj}(\ell' + k + m') \geq p_{ji}(\ell')\, p_{ii}(k)\, p_{ij}(m')$, and summing over $k$ shows $\sum_n p_{jj}(n) = \infty$. So $j$ is recurrent.
This proves part (1): recurrence (and transience) is uniform within a communicating class.
[/guided]
[/step]
[step:Show that every recurrent communicating class is closed]
Suppose $C$ is a communicating class containing a recurrent state, and suppose for contradiction that $C$ is not closed. Then there exist $i \in C$ and $j \notin C$ with $p_{ij} > 0$.
Since $j \notin C$ and $C$ is a communicating class, $j$ does not communicate with any state in $C$. In particular, $j \not\to i'$ for any $i' \in C$. (If $j \to i'$ for some $i' \in C$, then since $i' \leftrightarrow i$ within $C$, transitivity would give $j \to i$; combined with $i \to j$ (since $p_{ij} > 0$), this would give $i \leftrightarrow j$, contradicting $j \notin C$.)
Therefore, once the chain moves from $i$ to $j$, it can never return to any state in $C$. Starting from $i$, the event "the chain moves to $j$ at time $1$" has probability $p_{ij} > 0$, and on this event the chain never returns to $i$. This gives
\begin{align*}
\mathbb{P}_i(T_i^+ = \infty) \geq \mathbb{P}_i(X_1 = j) \cdot \mathbb{P}_j(\text{never visit } C) = p_{ij} \cdot 1 = p_{ij} > 0.
\end{align*}
Hence $\mathbb{P}_i(T_i^+ < \infty) \leq 1 - p_{ij} < 1$, so $i$ is transient. But $i \in C$ and $C$ contains a recurrent state, so by part (1) $i$ must be recurrent -- a contradiction. Therefore $C$ is closed.
[guided]
For part (2), we must show that a recurrent communicating class cannot "leak" probability to outside states.
Suppose $C$ is a communicating class with a recurrent state, but $C$ is not closed. Then there exist $i \in C$ and $j \notin C$ with $p_{ij} > 0$. We claim the chain can never return to $C$ after visiting $j$.
Why can the chain not return? If $j \to i'$ for any $i' \in C$, then since all states in $C$ communicate, $i' \to i$, giving $j \to i$ by transitivity. But $i \to j$ (since $p_{ij} > 0$ means $p_{ij}(1) > 0$), so $i \leftrightarrow j$. This contradicts $j \notin C$, since $C$ is the equivalence class of $i$ under $\leftrightarrow$.
So $j$ cannot reach any state in $C$. Starting from state $i$, with probability $p_{ij} > 0$ the chain steps to $j$ at time $1$, after which it never returns to $C$ (and hence never returns to $i$). This means
\begin{align*}
\mathbb{P}_i(T_i^+ = \infty) \geq p_{ij} > 0,
\end{align*}
so $i$ is transient. But by part (1), all states in $C$ share the same recurrence/transience classification, and we assumed $C$ contains a recurrent state, so $i$ must be recurrent. This contradiction shows $C$ must be closed.
[/guided]
[/step]