Solution (source code)

= Solution

Choose $\delta=cN^{-2}$ with a sufficiently small absolute $c$. If an integer $b$ satisfies $\operatorname{dist}(b\sqrt2,\mathbb Z)<\delta$, then for every $|n|\leq N$ the phase
$$
b(\sqrt2n_1^2+n_2^2)
$$
lies within $c$ of an integer. All summands defining $f(0,b)$ therefore have positive real part bounded below, and $|f(0,b)|\geq a_0N^2$.

The supplied equidistribution estimate produces $\gtrsim\delta T\asymp T/N^2$ such integers in $[0,T]$, and distinct integer times are separated by at least one. For $T\lesssim N^2$, include instead one time $t=c'N^{-2}\in(0,T)$, at which both quadratic phases are uniformly small. Discarding endpoints and, if necessary, every other selected integer leaves a set $\mathcal T\subset(0,T)$ with
$$
|\mathcal T|\gtrsim T/N^2,
\qquad |t-t'|\geq1,
\qquad |f(0,t)|\geq a_0N^2.
$$

Solved by gpt-5.6-sol high.