Working through an example of measure theoretic conditional expectation I am trying to internalise the measure theoretic definition of conditional expectation.
Consider a fair six-sided die. Formally the probability space is $(\{1, 2, 3, 4, 5,6\}, \mathcal{P}(1, 2, 3, 4, 5, 6), U)$ where $U$ is the discrete uniform distribution. Let the real-valued random variable map the identity map on the sample space so that $X(\omega) = \omega$.
Byron Schmuland answered this question in a way that gives a lot of intuition. Suppose that after the die is rolled you will be told if the value is odd or even. Then you should use a rule for the expectation that depends on the parity. However I still don't see how to formalise his point.
Let the conditioning $\sigma$-field be $\mathcal{G} = \{\emptyset, \Omega, \{1, 3, 5\}, \{2, 4, 6\}\}$ as this includes the events that the value is even or odd. My question is, what is a full and formal description of $E(X | \mathcal{G})$.
Is it this?
\begin{equation}
  E(X | \mathcal{G}) = 
  \begin{cases}
  0 & \mbox{if $A = \emptyset$} \\
  3.5 & \mbox{if $A = \Omega$} \\
  3 & \mbox{if $A = \{1, 3, 5\}$} \\
  4 & \mbox{if $A = \{2, 4, 6\}$}
  \end{cases}
\end{equation}
In particular I feel unsure about the cases where $A = \emptyset$ and $A = \Omega$.
 A: A crucial point is that $Y=\mathrm E(X\mid \mathcal G)$ is a random variable (hence I really do not know what the identities at the end of your post could mean), which is entirely determined by two conditions. One first asks that 

$Y:\Omega\to\mathbb R$ is measurable with respect to $\mathcal G$. 

Since $\mathcal G\subset \mathcal F$, this is really a supplementary condition when compared to the condition of being measurable with respect to $\mathcal F$, as any random variable is.
In your case, $\mathcal G=\sigma(B)$ with $B=\{2,4,6\}$ hence one knows a priori that $Y=b\mathbf 1_B+c$ for some $b$ and $c$. To compute $b$ and $c$, one uses the other condition on $Y$, besides being measurable with respect to $\mathcal G$, which is that 

$\mathrm E(X;C)=\mathrm E(Y;C)$ for every $C$ in $\mathcal G$. 

Here, $\mathrm E(Y;B)=u$ with $u=\mathrm E(X;B)$ and $\mathrm E(Y)=v$ with $v=\mathrm E(X)$. Since $\mathrm P(B)=\frac12$, $\frac12(b+c)=u$ and $\frac12b+c=v$, which yields $b$ and $c$. 
Thus, $\mathrm E(X\mid \mathcal G)(\omega)=c$ if $\omega=1$, $3$ or $5$ and $\mathrm E(X\mid \mathcal G)(\omega)=b+c$ if $\omega=2$, $4$ or $6$. Numerically, $u=2$ and $v=\frac72$ hence $b=1$ and $c=3$, and 
$$
\mathrm E(X\mid\mathcal G)=\mathbf 1_B+3.
$$
Note: Let me strongly advise anyone interested in these matters to read the wonderful little book Probability with martingales by David Williams. 
A: The conditional expectation is a random variable, and therefore your notation does not quite fit. I would write it as:
$$
E[X\mid\mathcal{G}](\omega)=
\begin{cases}
3, \quad \omega\in\{1,3,5\},\\
4, \quad \omega\in\{2,4,6\}.
\end{cases}
$$
Now all you have to check is that this random variable satisfies the conditions for being the conditional expectation. That is, $E[X\mid\mathcal{G}]$ is $\mathcal{G}$-measureable and
$$
E[E[X\mid\mathcal{G}]\,;A]=E[X\, ;A],
$$
for every $A\in\mathcal{G}$. Here $E[\;; A]$ denotes integration over the set $A$. Now you just have to check each of the cases:


*

*$E[X\mid\mathcal{G}]^{-1}(B)=\{1,3,5\}$ if $3\in B$ and $4\notin B$,

*$E[X\mid\mathcal{G}]^{-1}(B)=\{2,4,6\}$ if $3\notin B$ and $4\in B$,

*$E[X\mid\mathcal{G}]^{-1}(B)=\Omega$ if both $3,4\in B$,

*$E[X\mid\mathcal{G}]^{-1}(B)=\emptyset$ if $3,4\notin B$,


and hence $E[X\mid\mathcal{G}]$ is $\mathcal{G}$-measureable. Now we have to check the second condition:


*

*$E[E[X\mid\mathcal{G}];\emptyset]=0=E[X;\emptyset]$,

*$E[E[X\mid\mathcal{G}];\{1,3,5\}]=3\cdot\frac{3}{6}=\frac{3}{2}=E[X;\{1,3,5\}]$,

*$E[E[X\mid\mathcal{G}];\{2,4,6\}]=4\cdot\frac{3}{6}=2=E[X;\{2,4,6\}]$,

*$E[E[X\mid\mathcal{G}];\Omega]=\frac72=E[X;\Omega]$.

A: The answers by @did and @StefanHansen are both great.  I thought I would explain my key misunderstanding in case it helps someone else.
A random variable is a function $Y: \Omega \to \mathbb{R}$. Even though we condition on $\mathcal{G}$ we only define $Y$ on $\Omega$!  $\mathcal{G}$ doesn't contain elements of $\Omega$ but only subsets; even if for example $\{1\} \in \mathcal{G}$.  I was confused and thought that since we were conditioning on $\mathcal{G}$ that we needed to define $Y$ for each $A \in \mathcal{G}$!
