(1) A function $f:\mathbb{R}^d \rightarrow \mathbb{R}$ is continuous almost everywhere, if the set {x: $f$ is not continuous at x} is a null set
(2) There exists a continuous function $g:\mathbb{R}^d \rightarrow \mathbb{R}$ such that $f=g$ almost everywhere.
(a) Make an example of a function that satisfies (1) but not (2)
(b) Make an example of a function that satisfies (2) but not (1)
I was playing around online and came across this and thought it looked interesting. Ideas?
Define $f \colon \mathbb{R} \rightarrow \mathbb{R}$ by
$$ f(x) = \begin{cases} \frac{1}{x} & x \neq 0 \\ 0 & x = 0 \end{cases}. $$
Then $f$ is continuous almost everywhere but there is no continuous $g \colon \mathbb{R} \rightarrow \mathbb{R}$ that agrees with $f$ almost everywhere (it would have to agree with $f$ everywhere on $\mathbb{R} \setminus \{ 0 \}$ but this is absurd).
On the other hand, if you take $f = \chi_{\mathbb{Q}}$ (the characteristic function of the rationals) then $f = 0$ almost everywhere but $f$ is not continuous at any $x \in \mathbb{R}$.