# Maximum likelihood on uniform distribution

In a exercise i'm doing it is asked to find the maximum likelihood estimator of a random sample $X_{1}, ... , X_{n}$ of a population with distribution $X\sim U(- \theta , \theta)$. I've found that the likelihood function is $\left (\frac{1}{2\theta} \right )^{n}$. Therefore this function decreases as theta gets larger. So, if I want to maximize the value of this function shouldn't I pick the minimum value of theta ?That is $X_{1}$? The problem is that in the answer book the MLE is described as $max(-X_{1} , X_{n})$ instead. This doesn't make sense to me at all, could anyone explain this?

You need $X_i \ge -\theta$ and $X_i \le \theta$ for all $i$.
This can be rewritten as $-X_i \le \theta$ and $X_i \le \theta$ or as $\max(-X_i,X_i) \le \theta$ for all $i$.
If $X_{(1)}$ is the smallest of the $X_i$ and $X_{(n)}$ is the largest then this can be written as $\max(-X_{(1)},X_{(n)}) \le \theta$.
So your likelihood function is in fact $$\left (\frac{1}{2\theta} \right )^{n} I[\max(-X_{(1)},X_{(n)}) \le \theta]$$ where $I[\,]$ is an indicator function taking the value $1$ when the event inside the brackets is true and $0$ when it is false.
As you say, for large $\theta$ this likelihood function decreases as $\theta$ increases and so you want $\theta$ to be as small as possible. However, when $\theta \lt \max(-X_{(1)},X_{(n)})$ the likelihood is zero, so the in this case the maximum likelihood is achieved when $$\theta = \max(-X_{(1)},X_{(n)}).$$