Prove that the graph of a continuous function $f:\mathbb{R} \rightarrow \mathbb{R}$ has measure zero.

real-analysissolution-verification

Lemma. The graph of a continuous function $f:\mathbb{R} \rightarrow \mathbb{R}$ has measure zero.

Note: this question has been answered before in various forms, but I want to see if my proof (i.e. the one most intuitive to me) is correct.

We will use a countable covering $S = \cup_{q \in \mathbb{Q}} S_q $ of G and show that each $S_q$ has measure zero.

Define $G := \{ (x, f(x)) : x \in \mathbb{R} \} \subset \mathbb{R}^2$, which is the graph of $f$.

Assume $\delta \le 1$ and $\epsilon < 0$.

$$
S_q := \{(q-\delta, q+\delta) \times (f(q) – \epsilon, f(q)+\epsilon) : q \in \mathbb{Q} \} \tag{1}
$$

Given the density of $\mathbb{Q}$ in $\mathbb{R}$,
$x \in \mathbb{R} \Rightarrow \exists q \in \mathbb{Q}$ such that
$$x \in (q – \delta, q + \delta) \tag{2} $$

Now we have $|x – q| < \delta$ and, from the continuity of $f$, $|f(x) – f(q)| < \epsilon$. It immediately follows that
$$
f(x) \in (f(q) – \epsilon, f(q)+\epsilon) \tag{3}
$$

Since $x \in \mathbb{R}$ was arbitrary, we now know that $S$ is a covering from $(2)$ and $(3)$. Showing that each $S_q$ in $(1)$ has measure zero will complete the proof, since the countable union of zero sets has measure zero. For any $q \in \mathbb{Q}$, write

$$
|S_q| = 2\delta 2\epsilon \le 2\epsilon.
\square
$$

Best Answer

The definition of continuity reads as follow:

$f$ is continuous at $x$, if for any $\epsilon >0$, there is $\delta >0$ so that $y\in (x-\delta , x+\delta)$ implies $f(y) \in (f(x)-\epsilon, f(x)+ \epsilon)$.

Note that $\delta$ depends on both $\epsilon$ and $x$. So you don't get to choose the width $\delta$ of your $S_q$. It depends on both $\epsilon$ and $q\in \mathbb Q$. In particular, for any $x\in \mathbb R$, it is not clear if $x \in (q-\delta , q+\delta)$ for some $q\in \mathbb Q$: the density of $\mathbb Q$ is not sufficient.

To deal with that, please see here. Instead of $\mathbb R$, one consider continuous function $$ f: [-M, M] \to\mathbb R$$ to show that this graph has measure zero. The main tools is that now $f$ is uniform continuous, thus $\delta$ is chosen independent of $x$ (Please read the details in that post).

With that result, the graph of $f : \mathbb R\to \mathbb R$ is a countable union of that of $f|_{[-M, M]}$, where $M \in \mathbb N$. Thus it is also of measure zero.

(Another mistake in your post is the claim that $S_q$ is of measure zero. This is of course not true).