Variance of the time of gambler's ruin The problem is as follows:

Let $\xi_1,\xi_2,\ldots$ be independent with $P(\xi_i = 1) = p$ and $P(\xi_i = −1) = q = 1−p$ where $p < \frac{1}{2}$. Let $S_n = S_0 +\xi_1 +\ldots+\xi_n$.  Let $V_0 = \min\left({n \le 0 : S_n = 0 }\right)$

(a) Show that $(S_n−(p−q)n)^2−n(1−(p−q)^2)$ is a martingale. 
(b) Use this to conclude that when $S_0 = x$ the variance of $V_0$ is
$x\cdot\frac{(1−(p−q)^2)}{(p−q)^3}$
I managed to show the expression in part a is a martingale. However, I'm not quite sure how to make the jump to finding the variance of the stopping time.

To simplify notation, let $r \equiv p- q$. First let us compute $\mathbb{E}[V]$. You might have already proved that $S'=S_n - nr$ is also a martingale.  Note that so is $S''$ which is $S'$ stopped at the barrier 0.  So, $$\mathbb{E}[S'']=x=\mathbb{E}[0-Vr]$$ from which we get $\mathbb{E}[V]=x/r$. 
Now consider the martingale M that you showed in part a. Let M' be M stopped at the same time V. Since M' is also a martingale, we get $$\mathbb{E}[M']=0$$ or
$$\mathbb{E}[(0-r V)^2]=\mathbb{E}[V] (1-r^2)$$ which gives 
$$\mathbb{E}[V^2]=\mathbb{E}[V]\frac{1-r^2}{r^2}=x \frac{1-r^2}{r^3}$$ which is the expression you have. 
However, I'm puzzled with your expression because variance is actually $$\mathbb{E}[V^2]-\mathbb{E}[V]^2$$ which is $$x \frac{1-r^2}{r^3} - \frac{x^2}{r^2}$$
