Solution (source code)

= Solution

A return to zero is possible only at even times, and
$$
P_0(X_{2k}=0)=\binom{2k}{k}[p(1-p)]^k.
$$
Stirling's estimate makes this asymptotic to a positive constant times
$$
\frac{[4p(1-p)]^k}{\sqrt k}.
$$
A state is recurrent exactly when the sum of its return probabilities diverges. If $p=1/2$, the resulting $k^{-1/2}$ <series> diverges. If $p\ne1/2$, then $4p(1-p)<1$ and the <series> converges geometrically. Thus the walk is recurrent exactly when $p=1/2$.