2.24 Lusin's Theorem1) Suppose $f$ is a complex measurable function on $X$, $\mu(A) < \infty$, $f(x) = 0$ if $x \notin A$, and $\epsilon > 0$. Then there exists a $g \in C_c(X)$ such that
$$ \mu(\{x : f(x) \neq g(x) \}) < \epsilon.$$
Question. If $\mu (A) = \infty$ in Lusin's theorem stated above, then does there exist $g \in C_c(X)$ such that
$$\mu (\{x \mid f(x) \neq g(x)\}) < \epsilon \quad ?$$
Notation: Here $C_c(X)$ set of all complex valued continuous functions on $X$ with compact support and $X$ is locally compact Hausdorff space.
I want to proceed by examples. Let $X = \mathbb{R}$. Take $A = \mathbb{Q}$ with the counting measure. So, $\mu (\mathbb{Q}) = \infty$. Let $f(x) = 0 $ when $x \in \mathbb{R}\setminus\mathbb{Q}$ and $x$ when $x\in \mathbb{Q}$. Clearly $f$ is a measurable. So, clearly the condition of $f$ in theorem is satisfied.
So, $f$ is nowhere continuous. Let $0< \epsilon < 1$. Now by the sake of contradiction assume that let $g \in C_c(\mathbb{R})$ such that $$\mu (\{x \mid f(x) \neq g(x)\}) < \epsilon$$ holds.
So, for the counting measure $\mu (\{x \mid f(x) \neq g(x)\}) < \epsilon$ implies the set $\{x \mid f(x) \neq g(x)\}$ is empty set. So, $f = g $ for all $x$. Hence, $f$ is itself a continuous function. So, we found a contradiction, as $f$ is not continuous.
Is it correct?