I am blocked trying to solve the following question. I would appreciate if someone could give me a hint.
Let $X_1,\ldots,X_n$ be $n$ independent random variables following a continuous uniform distribution $U(0,\theta)$, with $\theta>0$. Let $W=\max(X_1,\ldots,X_n)$. I have proved that, for any measurable and bounded functions $h:\mathbb{R}^n\to\mathbb{R}$ and $g:\mathbb{R}\to\mathbb{R}$, $$\mathbb{E}_\theta[h(X_1,\ldots,X_n)g(W)]=\int_{-\infty}^{\infty}H(s)g(s)f_W(s;\theta)ds,\tag{1}$$ where $f_W(s)$ is the density function of the random variable $W$ and $H(s)$ is a function which does not depend on $\theta$. I would like to deduce from (1) the sufficiency of $W$ (which is intuitively clear for me) but I get stuck in all my trials. I have tried by writing the the distribution functions in terms of the expectation of an indicator function conditioned to the value of $W$ and then applying the properties of the conditioned expectation, but I cannot get something clear.
Could anyone give me some ideas?