Existence of a certain Schwartz function with compact Fourier support

All probabilists know there can be no such $f$, not even in $L^1$, or for measures $\mu(dx)$ more generally than $f(x)dx$. This can be seen many different ways. The usual argument starts by showing that if $\hat f(x)=1$ on a neighborhood of $0$ then $\int_{\mathbb R} (1-\cos(tx))f(x)dx = 0$ for all $t\in[-1,1]$. Since the integrand is non-negative, $f$ must vanish for all $x$ for which $tx$ is not an integer multiple of $\pi/2$, for all $|t|\le 1$, and so for all $x\ne 0$.

But I forgot this fact, and came up with this, instead:

The function $\hat f$ must satisfy the Bochner condition, that for each finite set $\{t_i\}$ of reals, the matrices $A=(a_{ij})$ where $a_{ij} = \hat f(t_i-t_j)$ are positive semidefinite. This, and the assumption that $\hat f=1$ on $[-1,1]$ is enough to show that $\hat f(t)=1$ for all $t$, as follows.

If $t_2-t_1\in [-1,1]$ and $t_3-t_2\in[-1,1]$ but $t_3-t_1\notin[-1,1]$, one can learn what $a = \hat f(t_3-t_1)$ is by noting that $A=\pmatrix{1&1&a\\1&1&1\\\bar a&1&1}$ is psd, and hence $q=(1,-2,1)A(1,-2,1)^T\ge0$. But $q=2(\Re a-1)$ so $\Re a\ge1$ and so $|a|\ge1$. But also the submatrix $\pmatrix{1&a\\\bar a&1}$ is psd, so its determinant $1-|a|^2$ cannot be negative, so $|a|\le1$. Hence so $A$ psd implies $a=1$. So now we know $\hat f(t)=1$ for all $t\in[-2,2]$. The same argument, applied inductively, shows $\hat f = 1$ on each set $[-2^k,2^k]$, and thus on $\mathbb R$.

The Bochner theorem is a basic fact in harmonic analysis. The Fourier transform of a non-negative measure, or function, is "positive definite", in the sense that the matrices formed from the FT as above, must be positive semidefinite. The Wikipedia article is perhaps too high-brow for beginners, the Wolfram MathWorld one is too terse, but there are expositions out there that should match your level.

The basic idea is that $\hat f(t-s) = \int_{\mathbb R} \exp(-2\pi i (t-s)x) f(x)dx$ (give or take some norming constants), so a sum like $$\sum_k\sum_l \bar x_k x_l \hat f ( t_k-t_l) = \int_{\mathbb R}\left| \sum_k x_k e^{-2\pi t_k x}\right|^2 f(x)dx\ge 0.$$ This is the easy part of the theorem. The hard part, that the collection of all such inequalities hold, and the requirement that $\hat f$ be continuous, is enough to imply that $f\ge0$ everywhere, is not needed in your case.