Solution (source code)

= Solution

Write $a=x_{(1)}=\min_i x_i$, $T=\sum_i x_i$ and $\overline x=T/n$. For nondegenerate data from the shifted <exponential distribution>, the <likelihood function> is
$$
L(\theta,\beta)=\beta^{-n}
\exp\!\left[-\frac{T-n\theta}{\beta}\right]
\mathbf1_{\{0\leq\theta\leq a\}}.
$$
For fixed feasible $\theta$, differentiating its <log-likelihood> with respect to $\beta$ gives
$$
-\frac n\beta+\frac{T-n\theta}{\beta^2}=0,
\qquad \widehat\beta(\theta)=\overline x-\theta.
$$
The derivative changes from positive to negative there. Substituting gives the profile <likelihood> $e^{-n}(\overline x-\theta)^{-n}$, which increases with $\theta$. Therefore the unrestricted <maximum-likelihood estimates> are
$$
\widehat\theta=a,\qquad \widehat\beta=\overline x-a,
$$
while under the <null hypothesis> $\theta=0$ the estimate is $\widetilde\beta=\overline x$. Their <likelihood ratio> is
$$
R=\frac{\overline x^{-n}e^{-n}}{(\overline x-a)^{-n}e^{-n}}
=\left(1-\frac a{\overline x}\right)^n.
$$
Since the <likelihood-ratio test> rejects for small $R$, the requested form is obtained with
$$
\boxed{g(x_1,\ldots,x_n)=\frac{x_{(1)}}{\overline x}
=\frac{n\min_i x_i}{\sum_i x_i},\qquad
C=\{x:(1-g(x))^n\leq k\}.}
$$
The formulas assume $\overline x>a$, which holds almost surely for a continuous sample with $n\geq2$; coincident observations give an unbounded unrestricted <likelihood> and can be treated by its supremum.

An exact calibration is available and also explains why <Wilks theorem> should not be applied here. Under the null, the <memoryless property> makes $A=nX_{(1)}$ and $D=\sum_i(X_i-X_{(1)})$ independent <gamma distributions> with common scale $\beta$ and shapes $1$ and $n-1$. By <beta sampling by gamma ratios>,
$$
1-g=\frac{D}{A+D}\sim\operatorname{Beta}(n-1,1).
$$
Consequently, for $0\leq k\leq1$,
$$
\Pr_0(R\leq k)=k^{(n-1)/n},\qquad
\boxed{k_\alpha=\alpha^{n/(n-1)}.}
$$
This yields an exact <test size> $\alpha$, independent of the unknown scale. The support endpoint and boundary null make this a <likelihood-ratio test for an exponential support endpoint>, with a different calibration from a regular one-parameter test.