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.
As you said in your edit, the fact that the conditional expectation $X_0\geq 0$ of $X\geq0$ is $P_0$-a.s. unique is because the density from the Radon-Nikodym theorem is itself $P_0$-a.s. unique, where $P_0$ denotes the restriction of $P$ to the sub-$\sigma$-algebra under consideration.
This is what Bauer means when he writes the following on page $111$:
" Being a density, $X_0$ is moreover $P_0$-a.s. determined ( cf. MI, 17.11)"
where MI is his book on Measure Theory and theorem 17.11 is the theorem showing uniqueness.
Now, the fact that $A$ holds $P_0$-a.s. does not imply that that $P_0(A)=1$ in general, since the event $A$ may not be measurable. This the point I think Bauer is trying to make here:
Since $\{X_0=X'_0\}$ is measurable we can say that $P_0\{X_0=X'_0\}=P\{X_0=X'_0\}=1$.