How to prove $\left\{ \omega|X(\omega)=Y(\omega)\right\} \in\mathcal{F}$ is measurable, if $X$ and $Y$ are measurable? Given a probability space $(\Omega ,\mathcal{F} ,\mu)$. Let $X$ and $Y$ be $\mathcal{F}$-measurable real valued random variables.  How would one proove that $\left\{ \omega|X(\omega)=Y(\omega)\right\} \in\mathcal{F}$ is measurable.
My thoughts: Since $X$ and $Y$ are measurable, it is true, that for each $x\in\mathbb{R}:$ $\left\{ \omega|X(\omega)<x\right\} \in\mathcal{F}$ and $\left\{ \omega|Y(\omega)<x\right\} \in\mathcal{F}$.
It follows that $\left\{ \omega|X(\omega)-Y(\omega)\leq x\right\} \in\mathcal{F}$
Therefore $\left\{ -\frac{1}{n}\leq\omega|X(\omega)-Y(\omega)\leq \frac{1}{n} \right\} \in\mathcal{F}$, for $n\in\mathbb{N}$.
Therefore $0=\bigcap_{n\in\mathbb{N}}\left\{ -\frac{1}{n}\leq\omega|X(\omega)-Y(\omega)\leq \frac{1}{n} \right\} \in\mathcal{F}$.
Am working towards the correct direction? I appreciate any constructive answer!

Let $Z\colon \Omega\to\mathbb R^2$ defined by $Z(\omega)=(X(\omega),Y(\omega))$, where $\mathbb R^2$ is endowed with the Borel $\sigma$-algebra $\mathcal B(\mathbb R^2)$. 


*

*Show that the fact that the projections are measurable implies that so is $Z$. 

*Show that the set $\{(x,x)\in\Bbb R\times \Bbb R)$ is $\mathcal B(\mathbb R^2)$-measurable. 

