Before I begin, full transparency: this is a homework question, so I would prefer hints over the actual answer.
Compute the Bayes estimator for $\theta$ based on a sample $X_1,...,X_n$ from the $U[0,\theta]$-distribution with respect to a $U[0,M]$ prior distribution
I know that the posterior is given by
$$p(\theta|x) \propto p(x|\theta)\pi(\theta)$$
Hence, we would get
$$p(\theta|x) = \frac{1}{\theta^n}\frac{1}{M}1_{\theta \geq \max{(X_i)}}1_{0 \leq \theta \leq M}$$
which can simplify to
$$p(\theta|x) \propto \frac{1}{\theta^n}1_{\max{(X_i)} \leq \theta \leq M}$$
Which is our posterior distribution. Now I integrate to find the Bayes estimator:
$$E(\theta|x) = \int_{\max{X_i}}^M \frac{1}{\theta^{n-1}}d\theta$$
Does my work seem correct? Thank you so much.