Do flat functions with flat Fourier transform exist?

Not sure why you want the $0$th moment to be $1$, this construction makes $f$ Schwartz such that all the moments of $f,\hat{f}$ vanish :

Take $h \in C^\infty_c([1/4,3/4])$ and let $$c_n = \int_0^1 h(x) e^{-2i \pi n x}dx, \qquad h(x) = \sum_{n=-\infty}^\infty c_n e^{2i \pi nx}, \qquad \forall k, \ \ \sum_{n=-\infty}^\infty c_n n^k = 0$$

Then take another $g \in C^\infty_c([1/4,3/4])$ and let

$$f(x) = \sum_{n=-\infty}^\infty c_n g(x-n) \quad \in S(\mathbb{R})$$

With $\displaystyle d_m = \int_{-\infty}^\infty g(x) x^mdx$ we obtain

$$\int_{-\infty}^\infty f(x) x^k dx= \sum_{n=-\infty}^\infty c_n \int_{-\infty}^\infty g(x) (x+n)^k dx = \sum_{m=0}^k {k \choose m}d_m \sum_{n=-\infty}^\infty c_n n^{k-m} = 0$$

And the same holds for $\hat{f}$ since $f$ vanishes on $[-1/4,1/4]$.


I think a simple inductive construction will work, though the details are somewhat tedious. My function $f(x)=\sum g_j(x-a_j)$ will consist of (widely) separated bumps located at $0<a_1<a_2<\ldots$.

I must show that these can be chosen such that $\int x^n f(x)\, dx=0$ and $f\in\mathcal S$. I start out with an odd $g_1$, so $\int f=0$, which is good, but unfortunately $\int xf\not=0$, which isn't. To address this issue, I use $g_2$, which will be chosen orthogonal to $1$, and such that $\int x(g_1+g_2)=0$ also. In the next step, I use $g_3$, which will be chosen orthogonal to $1,x$, and such that $\int x^2(g_1+g_2+g_3)=0$ also.

The key observation is that the orthogonality that I impose to preserve earlier achievements is translation invariant in the sense that $g(x)$ is orthogonal to $1,x,\ldots , x^N$ precisely if $g(x-a)$ is. This means that by taking $a$ large, I can make $g_n$ as small as I want to in a given step, and this allows me to keep $f\in\mathcal S$ overall. (This requirement is really the list of conditions $|f^{(k)}(x^2+1)^m|\le 1$, $x\ge x_{N,k}$, and I satisfy these by paying attention to the first $N$ of these at a given step, and $N$ is increased gingerly.)

Remark: I'm no expert on these things, but I think it's known that there are measures (and functions, I would think) $f$ such that both $f$ and $\widehat{f}$ vanish on an interval, but I don't know if there are such examples in $\mathcal S$.