Actually, we can even show that $\mathbb E|Y_n-\mathbb E[X_1]|^2\to 0$. Indeed, since $\sum_{j=1}^nj=n(n+1)/2$ and $\mathbb E[X_j]=\mathbb E[X_1]$ for all $j$,
$$Y_n-\mathbb E[X_1]=\frac 2{n(n+1)}\sum_{j=1}^nj(X_j-\mathbb E[X_j]),$$
hence
$$\tag{1}\mathbb E|Y_n-\mathbb E[X_1]|^2=\frac 4{n^2(n+1)^2}\sum_{i,j=1}^n
ij\mathbb E\left[(X_i-\mathbb E[X_i])(X_j-\mathbb E[X_j])\right].$$
If $i\neq j$, then by independence $\mathbb E\left[(X_i-\mathbb E[X_i])(X_j-\mathbb E[X_j])\right]=0$ and plugging it in (1),
$$\tag{2}\mathbb E|Y_n-\mathbb E[X_1]|^2=\frac 4{n^2(n+1)^2}\sum_{j=1}^n
j^2\mathbb E\left[(X_j-\mathbb E[X_j])^2\right].$$
Using now the fact that $X_j$ has the same distribution as $X_1$ and bounding $\sum_{j=1}^nj^2$ by $n^2(n+1)$, equality (2) becomes
$$\mathbb E|Y_n-\mathbb E[X_1]|^2\leqslant\frac 4{n+1}\mathbb E\left[(X_0-\mathbb E[X_0])\right]^2$$
and we are done.
Your derivation is only partially correct because you have not taken the composite null hypothesis into account. When you have a composite null hypothesis, you need to consider two cases. First the case where the mle is within the null set and then the case where it is not.
Assume first that the mle $\bar{X}<0$ then the maximized likelihood under the null and the alternative is the same.
In the more interesting scenario that $\bar{X}>0$, the LRT
$$\lambda(\mathbf{x})=\frac{\sup_{\Theta_0}L(\theta|x)}{\sup_{\Theta}L(\theta|x)}\leq c$$
indeed reduces to
$$-\frac{n}{2\sigma^2}(\bar{x}-\mu_0)^2\leq log(c)=c^{\prime}$$
where $\mu_0\leq 0$. Since $\mu_0<\bar{X}$ this allows you to take square roots without needing the absolute value and so we get the rejection rule
$$\bar{X}\geq k$$
where $k=\sqrt{ -\frac{2\sigma^2}{n}c^{\prime}}+\mu_0$. Notice that since $\sigma^2$ is known we are treating it as a constant. It doesn't matter how one defines the constant because in the end you will want to select $k$ such that
$$P_{H_0} \left( \bar{X}\geq k \right)=\alpha \iff P_0 \left( \frac{\bar{X}}{\sigma}\geq \frac{k}{\sigma} \right)=\alpha \iff \Phi\left(\frac{k}{\sigma}\right)=1-\alpha $$
where $\alpha$ is a prespecified significance level. Under the normality, the ratio $\displaystyle{\frac{\bar{X}}{\sigma}}$ is the well known $Z$-test (can you guess which test the LRT would reduce to had we not known $\sigma^2$?). If you select $k$ based on this, you can then determine the constant $c$ if you so desire but this is highly unnecessary.
To sum up then, the LRT equals
$$\lambda \left(\mathbf{x} \right)=\begin{cases} 1 & \bar{X} \leq 0 \\ \frac{\bar{X}}{\sigma} & \bar{X} >0 \end{cases} $$
and you reject if the latter quantity is too large. I trust that you can derive the power function yourself now?
Best Answer
I'll outline an answer with a different example, rather than in terms of the specific details of this question.
A p-value ...
In your particular case, the more extreme cases are the ones more consistent with the alternative.
Let's say we have a sample mean of 5.347, and $\mu_0=2.5$
The z-statistic is $Z=\frac{\bar{x}-2.5}{5/\sqrt{10}}=1.8$
If the true population mean was 2.5 (i.e. the equality null), and we have the assumed normal distribution and the specified value for $\sigma$, then:
(a) the data should be normally distributed with mean $2.5$ and s.d. $5$ -- i.e. it should have this density:
(b) the sample mean should be normally distributed with mean $2.5$ and s.d. $5/\sqrt{10}$, so it should have this density:
(c) the standardized sample mean $Z=\frac{\bar{x}-2.5}{5/\sqrt{10}}$ should represent a single draw from a standard normal distribution:
(1) Under the equality null, $\mu=\mu_0$; , the alternative is values not equal to $\mu_0=2.5$ (values of the sample mean most suggestive of the alternative are values far from 2.5 in either direction). The probability of a result at least as extreme as the one observed (i.e. away from 2.5 in either direction) corresponds to values in this shaded region, and the probability is the shaded area:
As for how you compute this probability, the precise steps involved depend on what tables you have or what software you use.
(2) In the case of the one-sided null $\mu\leq \mu_0$, the alternative would be values greater than $\mu_0$, so the p-value is the area in the tail to the right of the observed statistic:
(3) In the case of the one-sided null $\mu\geq \mu_0$, the alternative would be values less than $\mu_0$, so the p-value is the area in the tail to the left of the observed statistic:
Here's a set of data consistent with the above sample mean if you want to start with some data:
(This is the data depicted in the first plot)