I want to find the following conditional expectation: $\mathbb{E}(X^2\mid\sin(X))$ where $X$ is distributed uniformly on $[0, \pi]$.
I guess if $\sin(X)=y$, then $X^2$ can be either $\arcsin(y)$ or $\pi-\arcsin(y)$. And maybe the formal proof should be based on this?
Let $X$ have the pdf $\rho_X$. Then $$\rho_{g(X)}(y) = \int_{\mathbb R} \delta(g(\tau) - y) \rho_X(\tau) d\tau = \sum_{\tau: \,g(\tau) = y} \mu(\tau), \quad \mu(\tau) = \frac {\rho_X(\tau)} {|g'(\tau)|},\\ \rho_{X, g(X)}(x, y) = \int_{\mathbb R} \delta(\tau - x) \delta(g(\tau) - y) \rho_X(\tau) d\tau = \sum_{\tau: \,g(\tau) = y} \mu(\tau) \delta(\tau - x), \\ \mathbb E(f(X) \mid g(X) = y) = \frac {\int_{\mathbb R} f(x) \rho_{X, g(X)}(x, y) dx} {\rho_{g(X)}(y)} = \frac {\sum_{\tau: \,g(\tau) = y} \mu(\tau) f(\tau)} {\sum_{\tau: \,g(\tau) = y} \mu(\tau)}, \\ \mathbb E(f(X) \mid g(X)) = \frac {\sum_{\tau: \, g(\tau) = g(X)} \mu(\tau) f(\tau)} {\sum_{\tau: \, g(\tau) = g(X)} \mu(\tau)}.$$ If $\rho_X(x) = [0 < x < \pi]/\pi$, $g(x) = \sin(x)$ and $X$ takes a value in $(0, \pi)$, the sums have two non-zero terms, corresponding to $\tau = X$ and $\tau = \pi - X$.