Consider a non-negative random variable defined om $(\Omega,\mathcal A, P)$. A conditional expectation $E[X|Y]$ of $X$ under $\sigma (Y)$ ($Y$ is another r.v.) is a $\sigma (Y)$ measurable r.v. such that $$ \int_{C} E[X|Y] dP = \int_{C} X dP, \forall C \in \sigma (Y)$$.
In my book (Probability Theory by Heinz Bauer) the author firstly shows existence of $E[X|Y]$. He shows how to construct a function $X_0$ which has all the needed properties. Then the author proves uniqueness by saying "Let's consider $X_1$ which is $\sigma (Y)$ measurable and satisfies the condition for integrals above, then $X_1 = X_0$ a.s. follows from the fact that $\{X_1 = X_0 \} \in \sigma (Y)$".
I clearly see why $\{X_1 = X_0 \} \in \sigma (Y)$ but I do not understand why from that one can conclude that $X_1 = X_0$ a.s. Any hints?
Edit
One can solve it if assumes that $X_1 \ge 0$, then $X_1$ can be viewed as a density for a measure defined on $\sigma (Y)$ and given by $\int_C X_1 d P_{|\sigma (Y)}, \forall C \in \sigma(Y)$, where $P_{|\sigma (Y)}$ is the restriction of $P$ for $\sigma (Y)$.
Now we get $$\int_C X_1 d P = \int_C X_1 d P_{|\sigma (Y)} = \int_C X_0 d P_{|\sigma (Y)} = \int_C X_0 d P, \forall C \in \sigma(Y)$$
So $X_0, X_1$ as densities define the same measure on $\sigma(Y)$ and thus are identical $P_{|\sigma (Y)}$-a.s. and consequently $P$-a.s.
So we can show that $X_0$ is a.s. unique among non-negative $\sigma(Y)$ measurable random variables (satisfying the equation for conditional expectations) and consequently among $\sigma(Y)$ measurable random variables which are a.s. non-negative and satisfy the equation.