This problem is from the Book, Harmonic Analysis by Katznelson (Problem 2, Page 160).
Suppose $f$, $g\in L^2(\mathbb{R})$ such that $f(x) = 0$ implies $g(x)=0$ for almost all $x\in\mathbb{R}$. Then show that for $\epsilon >0$, there exists a twice differentiable compactly supported $\phi$ such that $\|\phi f - g\|_{L^2(\mathbb{R})}< \epsilon$.
Hints and suggestions are welcome.
Let $f\in L^{2}(\mathbb{R})$, and let $E:=\text{supp}(\widehat{f})=\left\{\xi\in\mathbb{R}:\widehat{f}(\xi)=0\right\}$. Here, we are choosing $f$ to be a representative element of its $L^{2}$ equivalence class or considering the equivalence class of $E$ modulo null sets. Consider the subset $H\subset L^{2}(\mathbb{R})$ defined by
$$H:=\left\{g\in L^{2}(\mathbb{R}) : \widehat{g}(\xi)=0, \quad \text{a.e. }\xi \in E\right\} \tag{1}$$
Proof: It is evident from the linearity of the Fourier transform that $H$ is a subspace. To see that $H$ is closed, suppose that a sequence $g_{n}\in H$ converges to some $g\in L^{2}(\mathbb{R})$. By the continuity of the Fourier transform, $\widehat{g}_{n}\rightarrow\widehat{g}$ in $L^{2}$; passing to a subsequence if necessary, we may assume that $\widehat{g}_{n}\rightarrow\widehat{g}$ almost everywhere (a.e.). As $\widehat{g}_{n}(\xi)=0$ for a.e. $\xi\in E$, it follows from disregarding a countable union of null sets that $\widehat{g}(\xi)=0$ for a.e. $\xi\in E$. To see that $H$ is translation-invariant, we recall the basic property of the Fourier transform that $\widehat{\tau^{h}g}=e^{-2\pi i h\cdot}\widehat{g}$. $\Box$
Since $L^{2}(\mathbb{R})$ is a (separable) Hilbert space, $H$ is a Hilbert space. I claim that $H=\overline{\text{span}}\left\{\tau^{y}f : y\in\mathbb{R}\right\}$. It suffices to show that if $g\in H$ satisfies $\langle{g,\tau^{y}f}\rangle=0$ for all $y\in\mathbb{R}$, then $g=0$ a.e. By Plancherel's theorem,
$$0=\langle{g,\tau^{h}f}\rangle=\langle{\widehat{g},\widehat{\tau^{h}f}}\rangle=\langle{\widehat{g},e^{-2\pi iy\cdot}\widehat{f}}\rangle=\left(\widehat{g}\overline{\widehat{f}}\right)^{\vee},\tag{2}$$
where in the last equality we use the fact that $\widehat{g}\overline{\widehat{f}}\in L^{1}(\mathbb{R})$ and therefore has a Fourier transform given by a $C_{0}(\mathbb{R})$ function. By Fourier inversion, we obtain that $\widehat{g}\overline{\widehat{f}}=0$ a.e. As $\widehat{f}\neq 0$ a.e. on $E^{c}$, we must have that $\widehat{g}\neq 0$ a.e. on $E^{c}$. Whence, $\widehat{g}=0$ a.e. and by Parseval's theorem, $g=0$ a.e.
Now given $\epsilon>0$ and $g\in H$, the preceding result gives us a finite linear combination of translates of $f$, $f_{\epsilon}:=a_{1}\tau^{y_{1}}f+\cdots+a_{m}\tau^{y_{m}}f$, such that
$$\epsilon>\left\|g-f_{\epsilon}\right\|_{L^{2}}=\left\|\widehat{g}-\widehat{f}_{\epsilon}\right\|_{L^{2}}=\left\|\widehat{g}-\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\cdot }\widehat{f}\right\|_{L^{2}} \tag{3}$$
It is evident that $\sum_{j}a_{j}e^{-2\pi i y_{j}\cdot}$ defines a $C^{\infty}(\mathbb{T})$ function. Let $N>0$ be sufficiently large so that
$$\int_{\left|\xi\right|\geq N}\left|\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\xi}\widehat{f}(\xi)\right|^{2}d\xi<\epsilon^{2}\tag{4}$$
Let $\varphi\in C_{c}^{\infty}$ be a smooth, compactly suppoted function which is $0\leq\varphi\leq 1$, $1$ on $[-N,N]$, and $0$ outside $(-2N,2N)$. Define a $C_{c}^{\infty}(\mathbb{R})$ function $\Phi$ by
$$\Phi(\xi):=\varphi(\xi)\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\xi}, \quad\xi\in\mathbb{R} \tag{5}$$
Observe that
$$\int_{\mathbb{R}}\left|\left[\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\xi}-\Phi(\xi)\right]\widehat{f}(\xi)\right|^{2}d\xi\leq\int_{N\leq\left|\xi\right|}\left|1-\varphi(\xi)\right|^{2}\left|\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\xi}\right|^{2}\left|\widehat{f}(\xi)\right|^{2}d\xi$$
To estimate the right-hand side (RHS), we note that $\left|1-\varphi\right|^{2}$, whence the RHS is $\leq$ $$\int_{\left|\xi\right|\geq N}\left|\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\xi}\right|^{2}\left|\widehat{f}(\xi)\right|^{2}d\xi<\epsilon^{2} \tag{6}$$
Using this estimate with (3), we conclude from the triangle inequality that
$$\left\|\widehat{g}-\Phi\widehat{f}\right\|_{L^{2}}\leq\left\|\widehat{g}-\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\cdot}\widehat{f}\right\|_{L^{2}}+\left\|\sum_{j=1}^{m}a_{j}e^{-2\pi i y_{j}\cdot}\widehat{f}-\Phi\widehat{f}\right\|_{L^{2}}<2\epsilon \tag{7}$$