I am trying to find the power and size of the test $I(X>\frac{1}{2})$ for the following conditions. $$X\sim f(x;\theta)=2\theta X+1-\theta; 0< X <1$$
$$\theta \in[-1,1]$$ $$H: \theta\le 0; A: \theta>0$$
The size of the test can be calculated as $$P\left(X>\frac{1}{2}\right)=\int_\frac{1}{2}^{1}(2\theta x+1-\theta)\, dx=\frac{1}{2}+\frac{\theta}{4}$$
Since the probability of rejection is decreasing in $\theta$ when $\theta \in[-1,0]$ the size is between $[\frac{1}{4},\frac{1}{2}]$
Similarly, the probability of rejection is increasing in $\theta$ when $\theta \in(0,1]$ so power is between $(\frac{1}{2},\frac{3}{4}]$
Is my understanding correct?
More generally, size of a test is defined as the supremum of the power function over all possible values of $\theta$ under the null hypothesis. So the supremum comes into play when you have a composite null.
Size of your test is thus $$\sup_{-1\le\theta\le 0}P_{\theta}\left(X>\frac12\right)$$
But power of a test is defined for a specific alternative. Hence for some $\theta_1\in(0,1]$, power is
$$P_{\theta_1}\left(X>\frac12\right)$$