Solution (source code)

= Solution

An irreducible continuous-time chain is recurrent when, after leaving any state, it returns there almost surely. Non-explosion ensures that returns of $X$ correspond exactly to returns of its embedded jump chain, so one is recurrent precisely when the other is.

The expected total occupation time of zero is
$$
\mathbb E_0\int_0^\infty\mathbf1_{\{X_t=0\}}dt
=\int_0^\infty p_{0,0}(t)dt.
$$
Each visit contributes an independent holding time of mean $1/q_0$. Thus this expectation is $(1/q_0)$ times the expected number of visits. If the integral is infinite, the jump chain has infinitely many expected visits; for an irreducible chain this is equivalent to recurrence.