In Introduction to Fourier Analysis on Euclidean Spaces, the authors explore the $L^2$ extension of the Fourier transform and argue that it is onto $L^2(\mathbb{R})$ but I can't follow their reasoning. Here is their proof from page 17:
Theorem 2.3. The Fourier transform is a unitary operator on $L^2(\mathbb{R}^n)$.
Proof: Since $\mathcal{F}$ is an isometry its range is a closed subspace of $L^2(\mathbb{R}^n)$. If this subspace were not all of $L^2(\mathbb{R}^n)$, we could find a function $g$ such that $\int_{\mathbb{R}^n}\hat{f}gdx = 0$ for all $f\in L^2(\mathbb{R}^n)$ and $||g||\neq 0$. The multiplication formula [Parseval's theorem] obviously extends to all of $L^2$ and so we have $\int_{\mathbb{R}^n} f\hat{g}dx = \int_{\mathbb{R}^n} \hat{f}gdx = 0$. But this implies that $\hat{g} = 0$ almost everywhere, contradicting the fact that $||g|| = ||\hat{g}|| \neq 0$.
I understand that the range is closed from the closed range theorem but I fail to understand how such a $g$ exists. I'm sure it's something simple that I'm missing but I don't see it. Everything else follows quite logically from there, but I'm stuck on this one fact. Would anyone mind clearing this up for me?