Solution (source code)

= Solution

Let
$$
N(\theta)=\#\{i:X_i<\theta\}.
$$
Ignoring the immaterial choice of density values at the sample points, the <likelihood function> is
$$
\boxed{
L(\theta)
=2^{-n}\left(1+\frac1\theta\right)^{N(\theta)}}.
$$
Between consecutive <order statistics>, $N(\theta)$ is constant while $(1+1/\theta)^{N(\theta)}$ decreases with $\theta$. A maximum can therefore be moved to the left endpoint of one of these intervals. With an equivalent version using $\mathbf1_{\{x\leq\theta\}}$, the maximum is attained at a sample order statistic. Thus the <maximum-likelihood estimator> coincides with one of $X_1,\ldots,X_n$.