The Problem:
Let $(\Omega, \mathcal{F}, \mathbb{P}) = ((0,1], \mathscr{B}(0,1], \lambda)$ in which $\lambda$ represents Lebesgue measure on the unit interval. Define the random variable $X: \Omega \to \mathbb{R}$ by $X(\omega) = \omega$.
Define the sub-$\sigma$-algebra $\mathcal{G}_1 = \sigma((0,\frac{1}{2}])$. Determine $\mathbb{E}[X | \mathcal{G}_1]$.
Where I Am:
$\mathbb{E}[X | \mathcal{G}_1]$ is any $\mathcal{G}_1$-measurable random variable $Y: (0,1] \to \mathbb{R}$ such that $$ \int_{G}Y d \lambda = \int_{G} X d \lambda = \int_{G} X(\omega)I_{G}(\omega) \lambda (d \omega) = \int_{G} \omega I_{G}(\omega) \lambda (d \omega) , $$ for each $G \in \mathcal{G}_1 = \left\{\emptyset, (0, \frac{1}{2}], (\frac{1}{2}, 1], (0, 1] \right\}$. This means that the following must be satisfied: \begin{align*} G = \emptyset &\implies \int_{G}Y d \lambda = \int_{G} \omega I_{G}(\omega) \lambda (d \omega) = 0, \\ G = (0, 1/2] &\implies \int_{G}Y d \lambda = \int_{0}^{1/2} x d x = \frac{1}{8}, \\ G = (1/2, 1] &\implies \int_{G}Y d \lambda = \int_{1/2}^{1} x d x = \frac{3}{8}, \quad \text{ and} \\ G = (0, 1] &\implies \int_{G}Y d \lambda = \int_{0}^{1} x d x = \frac{1}{2}. \end{align*} I assume, however, that there is more I am supposed to say about $Y$. I don't know if it is possible to write down a formula for $Y$ (I can't think of how one would do this), or what. My thought is to consider the measurability condition, which has me rather confused...
Indeed: Let $B \in \mathscr{B}$, where $\mathscr{B}$ is the Borel $\sigma$-algebra on $\mathbb{R}$. I'd like to verify that $Y^{-1}(B) \in \mathcal{G}_1$. Well, since intervals of the form $(a,b]$ generate $\mathscr{B}$, we may assume WLOG that $B= (a,b]$, for some $a, b \in \mathbb{R}$ with $a < b$. But is there anything I can really say here about $Y^{-1}(a,b]$ without any more information? My thought here was just to try the formula $Y(\omega) = \omega$ (since this obviously satisfies the integral conditions above). But then, e.g., $Y^{-1}(0,1/4]$ would just be $(0,1/4]$, which does not belong to $\mathcal{G}_1$. I'm really not sure what I'm supposed to do here...
Hint: $E(X|\mathcal G)$ is of the form $aI_A+bI_B$ where $A=(0,\ \frac 1 2]$ and $B=[\frac 1 2 ,1]$. Compute $a$ and $b$ by integrating over $A$ and $B$. [You should get $a=\frac 1 4$ and $b=\frac 3 4 ].
In general if $\mathcal G$ is the sigma algebra generated by a partition $\{A_1,A_2,...,A_n\}$ the any measurable function w.r.t. $\mathcal G$ has the form $\sum a_iI_{A_i}$. In this case $\mathcal G$ is generated by $\{A,B\}$.