We say a measurable function $f: \mathbb R^n \to \mathbb R$ is *essentially continuous* if the inverse image of any open set $O$ differs from an open set by a set of null measure, in the sense that there exists an open subset $U$ of $\mathbb R^n$ such that $\mu(f^{-1} (O) \, \Delta \, U) = 0$ where $\Delta$ denotes the symmetric difference and $\mu$ denotes the Lebesgue measure.


**Question:** Is it true that $f$ is essentially continuous if and only if $f$ agrees a.e. with a function that is continuous a.e.?


*Remark: The chosen open set $U$ is allowed to be empty.*



A topological characterisation of a.e. continuity
I adapt the proof of a more general result: Theorem 4.12 in Chapter XI of K. Kuratowski and A. Mostowski’s book “*Set Theory: with an introduction to descriptive set theory*” (see page 408).


**Claim.** *$f$ is essentially continuous iff there exists a null set $N$ such that $f|({\bf R}^n-N)$ is continuous.*


**Proof.** ($\Rightarrow$) Let $U\_1$, $U\_2$, … be an open base of $\bf R$. By assumption, $$f^{-1}(U\_n)=(O\_n-A\_n)\cup B\_n,$$ where $O\_n$ is open and $A\_n$, $B\_n$ are null sets. Set $N=\bigcup\_nA\_n\cup\bigcup\_nB\_n$, so that $N$ is a null set. We show that $g=f|({\bf R}^n-N)$ is continuous. Let $H\subset\bf R$ be open; we prove that $g^{-1}(H)=f^{-1}(H)-N$ is open in ${\bf R}^n-N$. Now $H=U\_{k\_1}\cup U\_{k\_2}\cup\cdots$, and so $$g^{-1}(H)=\bigcup\_nf^{-1}(U\_{k\_n})-N=\bigcup\_n\bigl((O\_{k\_n}-A\_{k\_n})\cup B\_{k\_n}\bigr)-N.$$ Since $A\_{k\_n}\cup B\_{k\_n}\subset N$, it follows that $$g^{-1}(H)=\bigcup\_nO\_{k\_n}-N,$$ which completes the proof since $\bigcup\_nO\_{k\_n}$ is open.


($\Leftarrow$) Let $N$ be a null set and suppose $g=f|({\bf R}^n-N)$ is continuous. Then, if $H\subset\bf R$ is open, the set $g^{-1}(H)=f^{-1}(H)-N$ is open in ${\bf R}^n-N$; that is, there exists open $O\subset{\bf R}^d$ such that $f^{-1}(H)-N=O-N$. Therefore, $$\begin{align\*}
f^{-1}(H) &= (f^{-1}(H)-N)\cup(f^{-1}(H)\cap N)\\
&=(O-N)\cup(f^{-1}(H)\cap N).
\end{align\*}$$
Since $N$ is a null set, $f^{-1}(H)\cap N$ is also a null set, and it follows that $f^{-1}(H)\triangle O$ is a null set. $\square$


