Let $f:\mathbb{R}\to\mathbb{R}$ such that $\begin{cases} 1 & x\in\mathbb{R}\setminus\mathbb{Q}\\ 0 & x\in \mathbb{Q} \end{cases}$
- Show that $f$ is not continuous almost everywhere.
- Show that $f$ is almost everywhere equal to a continuous function.
For (1) I got a bit confused
$f$ is continuous at $a$ if for all $\epsilon > 0$, there exists $\delta > 0$ such that if $0<|x-a|<\delta$ then $$|f(x)-f(a)|<\epsilon$$
Suppose $f$ is continuous at $a\in\mathbb{R}\setminus\mathbb{Q}$, with $\delta_a$. Consider $\epsilon < 1$. Then supposedly $|x-a|<\delta_a$ implies $$|f(x)-f(a)| < 1 $$
But $\mathbb{Q}$ is dense in $\mathbb{R}$ so there exists $x_0\in\mathbb{Q}$ such that $|x_0-a|<\delta_a$ and yet $$|f(x_0)-f(a)| = 1 \nless 1 $$
So $f$ is not continuous at any irrational number. In fact using the same reasoning, $f$ is not continuous at any rational number either. Hence it is not continuous almost everywhere.
For (2) you note that $g(x) :=1$ is continuous $$f = g \quad\text{almost everywhere}$$ because $\{x : f(x)\neq g(x)\} = \mathbb{Q}$ and $\mu(\mathbb{Q})=0$
Do these arguments make sense?
Yes, but in your definition of continuity, you should replace $0<|x-a|<\delta$ with $|x-a|<\delta$. Also, in your argument, you should specify that you are taking $\epsilon<1$ and then let $\delta>0$ be arbitrary, since you are trying to show that $\exists>0$ $\forall\delta>0$ there is an $x$ with $|x-a|<\delta$ but $|f(x)-f(a)|<\epsilon$.
You are also correct in stating that a similar argument proves that $f$ is not continuous at any $\mathbb{Q}$ and, hence, is in fact nowhere continuous.