Solution (source code)

= Solution
{c}

The <Bessel process> is stopped in the compact interval $[\alpha,\beta]$, where its drift and diffusion coefficients are bounded. In particular its stopped stochastic integral has expectation zero on every finite time interval.

For $k>1$, taking expectations in the stopped equation gives
$$
\mathbb E Y_t-1=\frac{k-1}{2}\mathbb E\int_0^{t\wedge\tau}\frac{ds}{y_s}
\geq\frac{k-1}{2\beta}\mathbb E(t\wedge\tau).
$$
Since $Y_t\leq\beta$, this bounds $\mathbb E(t\wedge\tau)$ uniformly in $t$. For $k<1$, the same argument with $1-\mathbb E Y_t$ gives $\mathbb E(t\wedge\tau)\leq2\beta(1-\alpha)/(1-k)$.

If $k=1$, the stopped process is a stopped Brownian motion. <Itô's formula> gives $\mathbb E(Y_t-1)^2=\mathbb E(t\wedge\tau)$, which is at most $\max\{(1-\alpha)^2,(\beta-1)^2\}$. Thus in every case the <monotone convergence theorem> gives $\mathbb E\tau<\infty$, so $\tau<\infty$ almost surely. By path continuity its value at exit is one of the two endpoints. They are disjoint possibilities, hence
$$
\boxed{\mathbb P(y_\tau=\alpha)+\mathbb P(y_\tau=\beta)=1.}
$$