To construct the UMP test, we have to construct the corresponding MP test. Hence, the LR is given by
\begin{align}
\frac{L_{1}(X_1,..,X_n|\lambda_1)}{L_{1}(X_1,..,X_n|\lambda_0)} = \frac{\prod_{i=1}^n \frac{e^{-\lambda_1} \lambda_1^{x_i}}{x_i!}}{\prod_{i=1}^n \frac{e^{-\lambda_0} \lambda_0^{x_i}}{x_i!}} &= \exp\{n(\lambda_0 - \lambda_1)\}\left(\frac{\lambda_1}{\lambda_0}\right)^{\sum_i^nx_i}\\
&= \exp\{n(\lambda_0 - \lambda_1)\}\left(\frac{\lambda_1}{\lambda_0}\right)^{n\bar{x}_n} > c\,.
\end{align}
This statistic depends on the distribution of $\bar{X}_n$, hence for large enough $n$ we can use the CLT to approximate the rejection region. Note that the MP is $\Psi(\mathrm{X}) = \mathcal{I}\left( \bar{X}_n >c' \right)$.
2.
\begin{align}
\alpha = \mathbb{E}_{\lambda_0}\Psi(\mathrm{X}) &= \mathbb{P}_{\lambda_0}\left( \bar{X}_n >c' \right)\\
&a\approx 1-\phi\left(\frac{c'-\lambda_0}{\sqrt{\lambda_0/n}} \right)\\
&c' = \lambda_0 + Z_{1-\alpha}\sqrt{\lambda_0/n}.
\end{align}
For $\lambda_0 = 1$,
$$
c' = 1 + Z_{1-\alpha}\sqrt{1/n}\,.
$$
- Power function for the parametric space $\Lambda = \mathbb{R}^+$.
\begin{align}
\pi(\Psi(\mathrm{X})|\Lambda) &= \mathbb{E}_{\Lambda}\Psi(\mathrm{X}) = \mathbb{P}_{\Lambda}(\bar{X}_n>c')\\
&=1-\phi\left( \frac{c'-\lambda}{\sqrt{\lambda/n}} \right),& \forall \lambda \in \Lambda.
\end{align}
Before trying to find a UMP test, one needs to first check if there exists one. To do this one needs to find the likelihood ratio function
$$l(x)=f_{\theta_1}(x)/f_{\theta_0}(x)$$
This function must be monotone non-decreasing in $x$ for every $\theta_1\geq \theta_0$. In the given question $\theta_1=2$, and the density function is $$f_{2}(x)=2x.$$ Similarly for $\theta_0\in[1/2,1]$, $$f_{\theta_0}(x)=\theta_0x^{\theta_0-1}$$ Hence, the likelihood ratio function is
$$l_{\theta_0}(x)=\frac{2x}{\theta_0x^{\theta_0-1}}=\frac{2}{\theta_0}x^{2-\theta_0}$$
Since this function is increasing in $x$ for all $\theta_0\in[1/2,1]$, there exists a UMP test of level $\alpha$.
By definition of UMP test, the significance level $\alpha$ is the expected value of the decision rule (which is the likelihood ratio test with a certain threshold $\lambda$), for which the false alarm probability lies below $\alpha$, for every $\theta_0$
$$\alpha=\sup_{\theta_0}\int_{\{x:l_{\theta_0}(x)>\lambda\}}f_{\theta_0}(x)\mathrm{d}x=\sup_{\theta_0}\int_{\{x:l_{\theta_0}(x)>\lambda\}}\theta_0x^{\theta_0-1}\mathrm{d}x$$
Now, we have a nice simplification (Why?) $${\{x:l_{\theta_0}(x)>\lambda\}}\equiv {\{x:x>\lambda^{'}\}}$$
Hence
$$\alpha=\sup_{\theta_0}\int_{\{x:l_{\theta_0}(x)>\lambda\}}\theta_0x^{\theta_0-1}\mathrm{d}x=\sup_{\theta_0}\int_{\lambda^{'}}^1\theta_0x^{\theta_0-1}\mathrm{d}x=\sup_{\theta_0}1-{\lambda^{'}}^{\theta_0}=0.05$$
It is known that $\lambda^{'}\in[0,1]$ and $\theta_0\in[1/2,1]$. Now what value of $\theta_0$ maximizes $1-{\lambda^{'}}^{\theta_0}$ or similarly minimizes ${\lambda^{'}}^{\theta_0}$?
The UMP test is then $$\phi(x)=\begin{cases}1,\quad x>\lambda^{'}\\0,\quad x\leq \lambda^{'}\end{cases}$$
Best Answer
Here is a rationale for the test that I hope you will find intuitive:
A good estimate of $\lambda$ is sample mean $\bar x = \frac{\sum_{i=1}^n x_i}{n} = T/n = 23/5 = 4.6.$ This estimate is larger than the hypothetical $\lambda_0 = 3.$ So you may wonder whether the random quantity $\bar x = \hat \lambda$ is sufficiently larger than $\lambda_0 = 3$ to reject $H_0$ in favor of the alternative. The question is how much larger is large enough for 'statistical significance'.
Testing at level $\alpha = 0.05,$ you are willing to make a mistake (specifically, a Type I Error) 5% of the time you do such a test. So you seek a 'critical value' $t_0$ such that $$P(T \ge t_0\,|\,n\lambda = n\lambda_0) = P(n\hat \lambda \ge t_0\,|\,n\lambda = 15) \le .05.$$
This amounts to supposing that $T \sim \mathsf{Pois}(15)$ and finding $t_0$ with $P(T \ge t_0) \le .05$ or $P(T < t_0) \ge .95.$ Because of the discrete nature of the Poisson distribution, it is not generally possible to find a critical value that corresponds precisely to $\alpha = .05.$ In R statistical software:
So it seems that $t_0 = 22$ is the smallest critical value that gives $\alpha = .05$ or smaller. In other words, reject if $\hat \lambda = \bar X \ge 22/5 = 4.4.$
Notes: (a) In practice, people sometimes use a normal approximation. Here we might try $$P(T \ge t_0) = P\left(Z= \frac{T - n\lambda_0}{\sqrt{n\lambda_0}} \ge \frac{t_0 - 15}{\sqrt{15}} \right) \approx .05,$$
where $Z$ is standard normal. Thus $\frac{t_0 - 15}{\sqrt{15}} \approx 1.645$ and $t_0 \approx 21.4.$ (This method sweeps the discreteness of the Poisson distribution 'under the rug' and the approximation may be inaccurate for Poisson rates of small or moderate size.)
(b) It may be worthwhile to ask with what probability we reject $H_0$ if the true rate is $\lambda = 5$, which is the 'power' of the test against alternative $H_a: \lambda_a = 5.$ Then we find $$P(T \ge 22\,|\,\lambda =n5 = 25) = 1 -P(T \le 21\,|\,\lambda = 25) = 0.7527.$$
In the plots below, the rejection region is to the right of the vertical dashed line.