I need to proof
$$\{X\neq Y\}=\bigcup_{q\in\mathbb{Q}}\{X>q,Y\leq q\}\cup\{X\leq q,Y>q\}$$
and also show $X=Y\ \ \ \ P-a.s.$
Given is that $X,Y$ are two random variables on the probability space $(\Omega,\mathcal{F},P)$ such that $E[|X|]<\infty$, $E[|Y|]<\infty$, als well as $E[X|\sigma(Y)]=Y$ and $E[Y|\sigma(X)]=X$
Now, my approach would be to proof both sides (like '$\subseteq$' first and then '$\supseteq$') and in the hints there is stated to use a density argument i.e. $\mathbb{Q}$ is dense in $\mathbb{R}$.
However I have no idea how to start and make the proof...can someone please help?
Update: Sorry, made a mistake, but try to look at the complement of $\{X\neq Y\}$, and I think you should be fine ;)
Update2: To refine my hint: \begin{align} &\left(\bigcup_{q\in\mathbb{Q}}\{X>q,Y\leq q\} \cup \{X\leq q,Y> q\}\right)^c\\ &= \bigcap_{q\in\mathbb{Q}}\{X>q,Y\leq q\}^c \cap \{X\leq q,Y> q\}^c\\ &= \bigcap_{q\in\mathbb{Q}}(\{X\leq q\}\cup\{Y>q\}) \cap (\{X> q\}\cup\{Y\leq q\})\\ &= \bigcap_{q\in\mathbb{Q}}(\{X\leq q\}\cup\{Y>q\}) \cap (\{X> q\}\cup\{Y\leq q\})\\ &= \bigcap_{q\in\mathbb{Q}}(\{q<X\leq q\}\cup \{q<Y\leq q\}\cup \{X,Y>q\}\cup \{X,Y\leq q\}) \end{align} Now it sould be easy to conclude the equality to $\{X=Y\}=\{X\neq Y\}^c$.
Update3: Since $\{q<X\leq q\} = \{q<Y\leq q\} = \emptyset$, we have $$\left(\bigcup_{q\in\mathbb{Q}}\{X>q,Y\leq q\} \cup \{X\leq q,Y> q\}\right)^c = \bigcap_{q\in\mathbb{Q}}(\{X,Y>q\}\cup \{X,Y\leq q\}).$$ Now you can observe that the right side consists of all Points $p$, such that for all $q\in\mathbb{Q}$ holds $X(p),Y(p)>q$ or $X(p),Y(p)\leq q$. Since $\mathbb{Q}$ is dense, it must be $X(p)=Y(p)$. (The converse inclusion is trivial.)