Let $f,g: \mathbb{R^n} \to [-\infty, \infty]$ be measurable functions.
Then, prove that $A:=\{ x \in \mathbb{R^n} \ | \ f(x)\neq g(x) \}$ is a lebesgue-measurable set.
Is my proof correct?
My proof is here.
$A$ can be written as $A=\{x \in \mathbb{R^n} \ | \ f(x)> g(x) \} \cup \{x \in \mathbb{R^n} \ | \ f(x)< g(x) \}$.
Let $B=\{x \in \mathbb{R^n} \ | \ f(x)> g(x) \} $, $C=\{x \in \mathbb{R^n} \ | \ f(x)< g(x) \}$.
Then, $B=\cup_{r\in \mathbb{Q}}\big(\{f > r \} \cap \{ g < r\}\big)$, since $B\supset \cup_{r\in \mathbb{Q}}\big(\{f > r \} \cap \{ g < r\}\big)$ is trivial, and if $x\in B,$ $f(x)>g(x)$ holds and there exists $r\in \mathbb{Q}$ s.t. $f(x)>r>g(x)$ thus $x \in \{f>r\} \cap \{g< r\}\subset \cup_{r\in \mathbb{Q}}\big(\{f > r \} \cap \{ g < r\}\big).$
And now, since $f$ and $g$ are measurable, $\{ f>r \}$ and $\{ g<r \}$ are measurable and therefore $B$ is measurable.
In the same way, we can see that $C$ is also mesurable.
Therefore, $A=B\cup C$ is measurable.