# Special divisors on hyperelliptic curves

I was reading a proof that used the following result

Let $C$ be a hyperelliptic of genus $\ge 3$ and $\tau \colon C \to C$ the hyperelliptic involution. If $D$ is an effective divisor of degree $g-1$ such that $h^0(D)>1$ then $D = x + \tau(x) + D'$ where $D'$ is an effective divisor.

My question is, how is this result proved? It seems equivalent to showing that $|D|$ contains the unique $g^1_2$ and this made me think of Clifford's theorem but this didn't lead to much. For $g = 3$ the result holds because then $|D| = g^1_2$. But already for $g = 4$ I'm stuck. I tried playing around with the Riemann-Roch theorem but didn't get far.

Suppose that $D=x_1+x_2+\cdots+x_{g-1}$. We may assume that $\tau(x_i)\neq x_j$ for all $i\neq j$. Now, assume that $D'=y_1+\cdots+y_{g-1}$ is an element of $|K-D|$. Then $x_1+x_2+\cdots+x_{g-1}+y_1+\cdots+y_{g-1}$ is an element of $|K|$ but we know that any such element is of the form $z_1+\tau(z_1)+\cdots+z_{g-1}+\tau(z_{g-1})$. After possibly renumbering the $z_i$ (as well as possibly replacing $z_i$ by $\tau(z_i)$) we may assume $x_1=z_1$ and then $x_2=z_2$ and so on. This gives $D'=\tau(D)$ which implies $h^0(K-D)\leq 1$. However, R-R and gives $h^0(D)=h^0(K-D)\leq1$ which contradicts assumptions.
It is easy to see that $D + \tau^*D$ is a canonical divisor. Suppose that $p$ is a ramification point of the $g^{1}_{2}$; since there are $2g-2$ such points, we may assume that $p$ is not a base point of $|D|$. Then we have effective divisors $D'$ and $D''$ in $|D|$, such that $p$ lies on $D'$ but not on $D''$. So $D' + \tau^*D''$ is an effective canonical divisor containing $p$; by Riemann-Roch, it has to contain $2p$. Since $p$ does not lie on $\tau^*D''$, the divisor $D'$ has to contain $2p$, and we are done.