Suppose $X_t$ is a collection of random variables from a measure space $(\Omega, \mathcal{F}, P)$ to $(\mathbb{R}, \mathcal{B}(\mathbb{R}))$ (to keep things simple), where $t \in \mathbb{R}$. Moreover let $\tau$ denote a random variable from $(\Omega, P)$ with values in $\mathbb{R}$. If $\mathcal{G}$ is a sub $\sigma$-algebra of $\mathcal{F}$ and these two conditions hold: 1) $X_t$ is independent of $\mathcal{G} \ \forall t\in \mathbb{R}$ 2) $\tau$ is $\mathcal{G}$-measurable; is it true that \begin{equation} \mathbb{E}[X_{\tau} \mid \mathcal{G}] = g(\tau) \end{equation} where $g(s)= \mathbb{E}[X_s]$? If $\tau$ takes only finitely many values (say $\tau(\omega) \in \{t_1,...,t_n\} \ \forall \omega \in \Omega$) the statement holds since we can write $X_{\tau}$ as
\begin{equation} X_{\tau} = \sum_{i=1}^{n} \mathbb{1}_{\{\tau = t_i\}}X_{t_i} \end{equation} and the statement becomes a simple application of the very well known fact for measurable functions $\phi(X,Y)$ where $X$ and $Y$ are random variables independent from $\mathcal{G}$ and $\mathcal{G}$-measurable respectively. What about the general case? Can I use some approximation argument based on the finite valued case I have already shown?
Edit: Thanks for the answers. As it has been shown we have at least to suppose the measurability of $X_{\tau}$, so what can be said in this case?