Construct a nonnegative nonzero Schwartz function whose Fourier transform is nonnegative and compactly supported. I tried the exercise with the hint that $\phi(x)=|\varphi\star\hat{\varphi}|^2$ could be the solution with $\varphi$ compactly supported and odd. Thus,    
\begin{align*}
-\varphi\star\hat{\varphi}(x)
&=\int_{\mathbb{R}}\varphi(y)\hat{\varphi}(y-x)\mathrm{d}y \\
&=\int_{\mathbb{R}}\varphi(y)\int_{\mathbb{R}}\varphi(z)e^{2\pi iz(x-y)}\mathrm{d}z\mathrm{d}y \\
&=\int_{\mathbb{R}^2} \varphi(z)\varphi(y)e^{-2\pi iyz}e^{2\pi izx}\mathrm{d}z\mathrm{d}y \\
&=\int_{\mathbb{R}}\hat{ \varphi}(z)\varphi(z)e^{2\pi ixz}\mathrm{d}z=(\hat{\varphi}\varphi)^{\vee}(x). 
\end{align*}
Furthermore, 
\begin{align*}
\hat{\phi}(x)
&=(\hat{\varphi}\varphi)\star(\hat{\varphi}\varphi)(x) \\
&=\int_{\mathbb{R}} \hat{\varphi}(y)\varphi(y)\hat{\varphi}(x-y)\varphi(x-y)\mathrm{d}y \\
&=\int_{\mathbb{R}} \hat{\varphi}(y)\varphi(y)\Bigg(\int_{\mathbb{R}} \varphi(\xi)e^{-i\xi(x-y)}\mathrm{d}\xi \Bigg)\varphi(x-y)\mathrm{d}y \\
&=e^{i\xi x}\int_{\mathbb{R}} \hat{\varphi}(y)\varphi(y)\Bigg(\int_{\mathbb{R}} \varphi(\xi)e^{-i\xi y}\mathrm{d}\xi\Bigg) \varphi(x-y)\mathrm{d}y \\
&=e^{i\xi x}\int_{\mathbb{R}} [\hat{\varphi}(y)]^2\varphi(y)\varphi(x-y)\mathrm{d}y \\
\end{align*}
But here I do not get that $\hat{\phi}$ is positive. Any suggestions? And why do we know that $\phi$ is a Schwartz function? 
Thanks for any helps! 
 A: I will use the Hint. If $\varphi$ and $\phi$ are as above and $\varphi$ is real, then
$$
\hat \phi  = (\varphi \star \hat \varphi) ^\wedge \star (\varphi \star \hat \varphi)^\wedge = (\hat \varphi \hat {\hat \varphi}) \star(\hat \varphi \hat {\hat \varphi}).
$$
As $\hat {\hat \varphi}(x) = \varphi(-x)$ and being this function odd, we obtain
$$
\hat \phi = (\hat \varphi \varphi) \star (\hat \varphi \varphi)
$$
As $\varphi$ is odd, $\hat \varphi(\xi) = -2 i \int_0^{+\infty} \sin(\xi x) \varphi(x) $; thus it is possible to choose $\varphi$ so that $\hat \varphi$ - that is purely imaginary, by oddity of the function - has negative imaginary part for positive $\xi$. Hence $\hat \phi$ is nonnegative and compactly supported (being the convolution product of two c.s. functions).
Notice that $\phi$ is a Schwarz function because is the composition of a smooth, locally bounded function with a Schwartz function (to prove this, use the properties of convolution) 
(Notice also that in your second chain of equalities you can not put the term $e^{i\xi x}$ out of the integral sign.)
How does the Hint come out? If $\psi$ is compactly supported, then $\psi \star \hat \psi$ has compactly supported Fourier transform. Moreover, if $\hat \Psi$ is compactly supported then $(\Psi^2)^\wedge$  is c.s.  Then it only remains to choose $\psi$ in order to have the desired sign properties...
A: It seems that the hint you are given is different from the one in Exercise 2.2.1, Classical Fourier Analysis written by Grafakos, which says:
Take $f=|\phi\ast\widetilde{\phi}|^2$, where $\hat{\phi}$ is odd, real-valued, and compactly supported; here $\widetilde{\phi}(x)=\phi(-x)$.
For convenience and consistence with your notation, the above hint says:
Take $f=|\check{\phi}\ast\widehat{\phi}|^2$, where $\phi\in\mathrm{C}_c^\infty(\mathbb{R}^n)$ is odd, real-valued, and compactly supported; here $\check{}$ denotes the inverse Fourier transform, $\widehat{}$ denotes Fourier transform, and $\widetilde{}$ remains the same as above.
And in the following lines, $\cdot$ denotes pointwise product and $\overline{g}$ is the complex conjugate of $g$.
Recall that $$\widehat{\overline{\phi}}=\overline{\check{\phi}},~\widehat{\widehat{\phi}}=\check{\check{\phi}}=\widetilde{\phi}.$$
Now begin the computation.
Since
$$f=|\check{\phi}\ast\widehat{\phi}|^2=(\check{\phi}\ast\widehat{\phi})\cdot\overline{(\check{\phi}\ast\widehat{\phi})},$$
we have
$$\widehat{f}=(\phi\cdot\widetilde{\phi})\ast\overline{(\widetilde{\phi}\cdot\phi)}.$$
We have assumed that $\phi$ is odd and real-valued, so $\widetilde{\phi}=-\phi$, $\overline{\phi^2}=\phi^2\geq0$. Thus,
$$\widehat{f}=(-\phi^2)\ast\overline{-\phi^2}=\phi^2\ast\phi^2.$$
Writing the last convolution in the integral form, we can easily prove that $\widehat{f}$ is nonnegative. The remaining desired properties of $f$ and $\widehat{f}$ are obvious.
