Since $U$ is a linear combination of Gaussian variables, it is a Gaussian variable. We only need to show that the expectation of $U$ and the variance of $U$ do not depend on $\theta$.
* The expectation of $y_i$ is $\theta$ for all $i$. Due to the linearity of the expectation, the expectation of $U$ is $E(U) = \frac{1}{\sqrt{\theta/n}} \left(\frac{1}{n}\,n\theta - \theta\right) = 0$ .
* The variance of $y_i$ is $\theta$ for all $i$. Due to the scaling and summation properties of the variance of uncorrelated variables, the variance of $U$ is $V(U) = \frac{n}{\theta} \left(\frac{1}{n^2}\,n\theta - 0\right) = 1$ .
Thus, $U\sim\mathcal{N}(0,1)$ is a pivotal quantity.