Square-integrability in lemma 4.30 of Folland's "A Course in Abstract Harmonic Analysis" This question was originally posted on MSE (https://math.stackexchange.com/q/3796602/793374), but nobody has found a correct answer in about two weeks, so I decided to repost it here:
In lemma 4.30 of Folland's "A Course in Abstract Harmonic Analysis" (Second Edition) one needs to show the square-integrability of the function $f$ defined below and I don't understand how Folland deduces it from the inequality below.


For context, $G$ is a locally compact abelian Hausdorff group and $dx$ is a Haar measure on $G$ (note that Folland defines Radon measures to be outer regular and inner regular on open sets). Furthermore $f$ is continuous, bounded and a linear combination of functions of positive type (this is encoded in the notation $f \in \mathcal{B}(G)$). Here is what i have tried so far:
With Plancherel's theorem we see (as in Folland's proof) that $$(L^1(G) \cap L^2(G), \|\cdot\|_2) \to \mathbb{C}, \ k \mapsto \int_G f(x) \cdot k(x) \, dx$$ defines a bounded linear functional which extends to a bounded linear functional $F \in L^2(G)^*$ by the BLT theorem (I removed the complex conjugation for linearity; this should not make a difference in the argumentation).
Now Riesz's theorem yields an $r \in \mathcal{L}^2(G)$ such that $F$ is given by integration against $r$, i.e. $$F(k) = \int_G r(x) \cdot k(x) \, dx \ \text{ for all } k \in L^2(G).$$
In particular we have $$\int_G f(x) \cdot k(x) \, dx = \int_G r(x) \cdot k(x) \, dx \ \text{ for all } k \in L^1(G) \cap L^2(G).$$
With this we can show that the set $N := \{x \in G: r(x) \neq f(x)\}$ is locally null with respect to the Haar measure $dx$ since for any Borel set $A \subseteq N$ with finite Haar measure we can set $$k(x) := 1_A(x) \cdot \frac{|f(x) - r(x)|}{(f(x) - r(x)) + 1_{G \setminus N}(x)}$$ to obtain a function $k \in L^1(G) \cap L^2(G)$, so $$0 = \int_G (f(x) - r(x)) \cdot k(x) \, dx = \int_A |f(x) - r(x)| \, dx,$$
i.e. $A \cap N = A$ has Haar measure $0$.
To conclude $f \in L^2(G)$ we now need to show that $N$ has Haar measure $0$ and this problem can be reduced further: The set $$R := \{x \in G: r(x) \neq 0\} = \bigcup_{n \in \mathbb{N}} \{x \in G: |r(x)| \geq \tfrac{1}{n}\}$$ is $\sigma$-finite since $r \in \mathcal{L}^2(G)$, so $R \cap N$ is again $\sigma$-finite and locally null. Hence $R \cap N$ has Haar measure $0$ and we only need to show that the set $$M := (G \setminus R) \cap N = \{x \in G: r(x) = 0 \neq f(x)\}$$
has Haar measure $0$.
 A: In the following attempt, I am shameless using the fact that $f$ is continuous and bounded. My philosophy on $L^p$-spaces is shaped heavily by Banach space theory rather than measure theory, and most of my experience is with $\sigma$-finite measure spaces, so I apologize if I have missed some subtleties or conversely if I have belaboured some easy points.

Pick a compact $K\subset G$ and set $k=1_K\cdot f$; this certainly belongs to every $L^p(G)$ since $f$ is continuous and bounded, and since Haar measure is finite on compact sets.
Then, using the inequality that you quote from Folland,
$$ \int_K f\overline{f} \,dx \leq {\Vert \phi \Vert}_2 \left( \int_K |f|^2 \right)^{1/2}$$
so that
$$
\int_K |f(x)|^2\,dx  \leq {\Vert\phi\Vert}_2^2
$$
(I think this is what someone was suggesting on MSE.) Now we are done provided we can justify the following claim.
Claim: Let $h\geq 0$ be a non-negative continuous bounded function on $G$, and let $\mu$ be a Radon measure on $G$. Then
$$ \int_G h\,d\mu = \sup_K \int_K h\,d\mu $$
where the supremum is over all compact $K\subseteq G$.
(Note that I am not assuming that $G$ is $\sigma$-compact.)
Proof of claim.
If the RHS is infinite there is nothing to prove; so we may assume it is finite, and denote this supremum by $C$. Clearly the LHS is $\geq C$ so we only need to establish the converse inequality.
Given $r \in (0,1)$, let $E_r= \{ x\in G \colon h(x) > r \}$. This is open, so by inner regularity of $\mu$ on open sets, there is an increasing sequence of compact subsets $K_1 \subseteq K_2 \subseteq \dots \subseteq E$ with $\mu(K_n) \nearrow \mu(E_r)$. But then, using our assumption,
$$
r\mu(K_n)  \leq \int_{K_n} h\,d\mu  \leq C \qquad\hbox{for all $n$}
$$
and so we have $\mu(E_r) \leq C/r<\infty$.
Since $E_r$ has finite measure and $\sup_n\mu(K_n)=\mu(E_r)$, the set $E_r \setminus \bigcup_{n\geq 1} K_n$ has measure zero and we have
$$
\int_{E_r} h\,d\mu = \lim_n \int_{K_n} h\,d\mu  \leq C.
$$
By taking $r\searrow 0$ along some decreasing sequence in$(0,1)$, it follows that $\int h\,d\mu \leq C$, as required.
