Exercise: Let $X_1,\ldots, X_n$ be a random sample from the distribution with density $$f(x|\theta) = \dfrac{2x}{\theta^2}\mathbb{1}_{(0,\theta)}(x)$$ w.r.t. the Lebesgue measure. Show that $T = \max(X_1,\ldots,X_n)$ is a sufficient statistic.
What I've tried: Using the Factorisation theorem I can rewrite $f(x|\theta)$ using Borel functions $g_\theta(T(X))$ and $h(x)$. We have that $f(x|\theta) = g_\theta(T(x))h(x)$, where $g_\theta(T(x)) = \dfrac{\max(X_1,\ldots,X_n)}{\theta^2}$ and $h(x) = \mathbb{1}_{(0,\theta)}(x)$, which would mean that $T(X)$ is in fact sufficient.
Question: Is my answer correct? If not; what would be the correct answer? Furthermore, why is $T(X)$ a sufficient estimator? If $T(X)$ is sufficient that means that the original data $X$ does not contain further information about $\theta$ right? But what if $T(X)\neq (0,\theta)$? Wouldn't we learn more about $\theta$ if we would know about another value $X_i\in (0,\theta)$?
Thanks in advance!
You can factor the likelihood function as,
$$ f(\textbf{x} | \theta) = \underbrace{\left(\prod\limits_{i=1}^nx_i\right)}_{h(\textbf{x})}\underbrace{\left(\frac{2^n}{\theta^{2n}}I\{\max\limits_{i}x_i \leq \theta\}\right)}_{g(T(\textbf{x}))} $$
Note that $x_i \leq \theta$ for all $i$ if and only if $\max\limits_{i}x_i \leq \theta$.
If you want to verify sufficiency directly, you can find the density of $T(\textbf{X}) = \max(X_1,..,X_n)$ (call it $g(T(\textbf{x}) | \theta)$ and show that the ratio $\frac{f(\textbf{x}|\theta)}{g(T(\textbf{x}) | \theta)}$ is independent of $\theta$.