Let $\mathrm{sinc}(x) = \sin(x)/x$ if $x\neq 0$ and $\mathrm{sinc}(0) = 1$. This is a smooth function.
Let $(a_n)$ a real sequence such that $\sum_n a_n$ converge, and let $$ f(x) = \sum_{n=0}^{+\infty} a_n \,\mathrm{sinc}(nx)^2. $$
I am trying to determine whether $f$ is continuous.
Here is what I have so far:
$a_n \to 0$, so there exists $M$ such that $|a_n| \leq M$ for all $n$. Let $\alpha>0$. For all $|x| \geq \alpha$, we have $|a_n \mathrm{sinc}(nx)^2| \leq M/(\alpha n)^2$, so that the series converges uniformly on $(-\infty,-a]\cup[a,\infty)$. Hence $f$ is defined and continuous on $\mathbb{R} \setminus \{0\}$.
If the series $\sum |a_n|$ converges, then $|a_n \mathrm{sinc}(nx)^2| \leq |a_n|$ so that the series converges uniformly on $\mathbb{R}$. In this case, $f$ is continuous on $\mathbb{R}$.
However in the case where $\sum_n |a_n|$ diverges, I don't know how to proceed. Maybe $f$ can be discontinuous at zero, but I have no idea on how to construct a conter-example.