Consider a non-empty connected open subset $U$ of $\mathbb{R}^n$. Suppose a measurable function $u:U\to\mathbb{R}$ is locally constant on $U$, then it must be constant on $U$ according to this question.
Here is my question:
What if one changes "locally constant" to "locally a.e. constant"? More precisely, assume that for every $x\in U$ there is an open neighborhood $V$ of $x$ in $U$ such that $u$ is constant a.e. in $V$. Can one conclude that $u$ is constant on $U$ a.e.?
[Motivation] This question is mostly for a rigorous last step in the proof of this problem.