Question 2.25 on Folland, Real Analysis I'm trying to solve the exercises from Real Analysis - Moderns Techniques and Their applications by Folland and I have questios about the exercise 2.25 b). The statement:
Let $f(x) = x^{-1/2}$ if $0<x<1$ and f(x)=0 otherwise. Let ${r_n}$ be and enumeration of the rationals, and set $g(x) = \sum_{n=1}^\infty 2^{-n} f(x-r_n)$. Then g is discontinuous at every point and unbounded on every interval, and it remains so after any modification on a Lebesgue null set.
It's proved before (item a) that $g$ is finite a.e.. If $g(x)<+\infty$, it's not so difficult to prove that $g$ is discontinuous at $x$ (there is a solution here: http://www.math.mcgill.ca/spicard/folland2.pdf) but I can't prove the same when $g(x)=+\infty$. I'm assuming that I have to see $g$ as a function $g:\mathbb R \longrightarrow [0,+\infty]$ and use the usual topology that Folland put in this set.
So, if I'm interpreting the question correctly, how can I prove that $g$ is discontinuous in a point $x$ such that $g(x)=+\infty$? The prove made in previously case doesn't help, because it shows that $g(x)$ can assume high values.
 A: I claim that the function $g$ is continuous at every point where $g(x) = \infty$.  Here is one way to see this.  Recall that a function $h:\mathbb{R}\to {\mathbb R}\cup\{-\infty,\infty\}$ is lower semicontinuous provided
$$
h(x) \le \liminf_{y \to x} h(y)
$$
for every $x\in \mathbb R$.  Put $h_n(x) = 2^{-n}f(x-r_n)$.  Then it is easy to check that $h_n$ is lower semicontinuous.  
Now it can be shown that any sum of non-negative lower semicontinuous functions is lower semicontinuous.  Thus $g$ is lower semicontinuous and so 
$$
g(x) \le \liminf_{y\to x} g(y) 
$$
for all $x\in \mathbb R$.  Now suppose that $g(x) = \infty$.  Then we automatically get
$$
\limsup_{y\to x}g(y) \le g(x).
$$
Hence we have
$$
\limsup_{y\to x} g(y) \le g(x) \le \liminf_{y\to x} g(y)
$$
and so $g$ is continuous at $x$.
A: By the monotone convergence theorem and Theorem 2.28,
$\int f = \lim\limits_{n \to \infty} \int_{1 / n}^1 x^{-1 / 2} \,dx = \lim\limits_{n \to \infty} \left.2 x^{1 / 2}\right|_{1 / n}^1 = \lim\limits_{n \to \infty} (2 - 2 n^{-1 / 2}) = 2.$
Therefore $\int |g| = \sum\limits_{n = 1}^\infty 2^{-n} \int f(x - r_n) \,dx = \sum\limits_{n = 1}^\infty 2^{-n} \int f = 2,$ by the monotone convergence theorem.
It follows that $g \in L^1(m),$ and $g < \infty$ almost everywhere by Proposition 2.20.
Let $E \subseteq \mathbb{R}$ be a null set and suppose that $h \in L^1(m)$ is equal to $g$ on $E^c.$
If $I \subseteq \mathbb{R}$ is an interval with at least two points, there exists $n \in \mathbb{N}$ such that $r_n$ is an interior point of $I.$
For each $k \in \mathbb{N}$ note that $(r_n, r_n + k^{-1}) \cap I$ has positive measure, so there exists $x_k \in ((r_n, r_n + k^{-1}) \cap I) \setminus E.$
Clearly $\lim\limits_{k \to \infty} x_k = r_n,$ in which case $\lim\limits_{k \to \infty} 2^{-n} f(x_k - r_n) = 2^{-n} \lim\limits_{k \to \infty} (x_k - r_n)^{-1 / 2} = \infty.$
But $2^{-n} f(x_k - r_n) \le g(x_k) = h(x_k)$ for all $k \in \mathbb{N},$ which implies that $h$ is unbounded on $I.$
This shows that $h$ is unbounded on every interval, so it is clearly everywhere discontinuous.
By part (a) $g^2 < \infty$ almost everywhere.
If $I \subseteq \mathbb{R}$ is an interval with at least two points, there exists $n \in \mathbb{N}$ such that $r_n$ is an interior point of $I.
There exists $\delta \in (0, 1)$ such that $(r_n, r_n + \delta) \subseteq I,$ and $$\int_I g^2 \ge \int_{r_n}^{r_n + \delta} g^2 \ge \int_{r_n}^{r_n + \delta} 2^{-2 n} f(x - r_n)^2 \,dx = 2^{-2 n} \int_0^\delta f^2 = 2^{-2 n} \int_0^\delta x^{-1} \,dx = \infty,$$
where the last step follows from an argument similar to (and is even in the undergraduate calculus textbooks).
