Let $Y_1, \ldots, Y_n$ be a random sample from the pdf $$f(y\mid\theta) = \theta y^{\theta - 1}, 0 < y < 1, \theta > 0 .$$ show that $$E\left(\frac{1}{2\theta\sum_{i = 1}^n W_i}\right) = \frac{1}{2(n-1)}$$
I have showed that $\sum_{i = 1}^n -\ln(Y_i)$ is sufficient for $\theta$, and if $W_i = -\ln(Y_i)$, I have showed that $W_i$ has an exponential distribution with mean $1/\theta$. I have also showed that $2\theta \sum_{i=1}^n W_i $ has a $\chi^2$ distribution with $2n$ degrees of freedom.
My first question can we treat $2\theta\sum_{i=1}^n W_i$ as just 1/y? If so, I got to the following step $$\int_0^\infty \frac{1}{y} f(y) dy = \frac{1}{\Gamma(n)} \frac{1}{2} \int _0^\infty u^{n-2} e^{-u} du$$... I am wondering how to solve $\int _0^\infty u^{n-2} e^{-u} du?$ I know it is going to be $\Gamma(n-1)$ but what is the process for finding it?
I am guessing in your first question, you wonder if you are allowed to divide by $Y=2\theta\sum_{i=1}^n W_i$ even though $Y$ might be zero.
The answer is yes, because $Y\ge0$ almost surely, hence $E\left(\frac{1}{Y}\right)$ is well-defined although it has no reason to be finite at this point.
If it bothers you to divide by zero, you can also note that $\mathbb{P}(Y=0)=0$, thus $1/Y<\infty$ almost surely and $E\left(\frac{1}{Y}\right)=E\left(\frac{1}{Y}1_{Y<\infty}\right)$, even though again, the expectation may be infinite.
As for your second question, you can write
$$\frac{1}{\Gamma(n)} \frac{1}{2} \int _0^\infty u^{n-2} e^{-u} du=\frac{1}{2(n-1)}\int _0^\infty\underbrace{\frac{1}{\Gamma(n-1)}u^{n-2} e^{-u}}_{\text{pdf of a }\Gamma(n-1,1)} du=\frac{1}{2(n-1)}.$$
You can also solve the integral by doing $n-2$ integrations by parts if you don't want to use the pdf of a $\Gamma$ distribution.