Preface:
This question is based on the answer to this question given in the comments.
The problem:
Consider the Lebesgue probability space on the interval $[0,1)$. (I.e. the state space is $Ω = [0, 1)$, the $\sigma$-field is the set of Lebesgue measurable sets and the measure is the Lebesgue measure.) We define the random variable $X$ as: $$X(w)=\begin{cases} 2w &, 0\leq w < 1/2 \\ 2w−1 &, 1/2\leq w<1 \end{cases}$$ Compute the conditional expectation $E(Y |X)$ where $Y : [0, 1) \to \mathbb{R}$ is a measurable function.
My question:
Why can we write $$E(Y\mid X)(\omega)=\frac{Y(\omega)+Y(\omega+\frac12)\mathbf 1_{2\omega<1}+Y(\omega-\frac12)\mathbf 1_{2\omega\geqslant1}}2$$ ? What theorem are we appealing to?
EDIT: I think an answer was given to a similar question here.