Convergence of Fourier series at $x=0$ Let $f$, $2\pi$-periodic and intergrable function defined as follows:
$$f(x) = \begin{cases} 1+\sin\frac{\pi^2}{x} &  x\in[-\pi,\pi),x\ne 0 \\ 
1 &  x=0 \end{cases} $$

Does the Fourier series of $f$ converge for $x=0$? If so, is it equal to $f(0)$? Hint: No need to evaluate $\hat{f}(n)$ (the $n$-th Fourier coefficient).

So the exercise suggest not to evaluate the coefficients of the Fourier series. Therefore, I came up with the idea to use convolution with $D_n(x)$ (Dirichlet kernel). I put it to the test:
$$S_n(f,x)=f\star D_n(x) = \frac{1}{2\pi}\int_0^{2\pi}f(x-t)D_n(x) $$
Now, I'm not sure but I think we can use the fact that $D_n(0)=2n+1$. Hence,
$$= (2n+1)\int_0^{2\pi} 1 - \sin\frac{\pi^2}{t} \ dt = \infty ?$$
 A: We can use your approach with the Dirichlet kernels, together with the hint about odd functions. These kernels are
$$D_n(t) = \frac{\sin (n+1/2)t}{\sin t/2}, n = 0, 1, \dots$$
Note each $D_n$ is an even function. Also recall that $(1/2\pi)\int_{-\pi}^\pi D_n(t)\, dt = 1.$ Thus
$$S_n(f,0) = \frac{1}{2\pi}\int_{-\pi}^\pi f(-t)D_n(t)\,dt = \frac{1}{2\pi}\int_{-\pi}^\pi [1 + \sin(-\pi^2/t)]D_n(t)\,dt$$ $$ = 1 + \frac{1}{2\pi}\int_{-\pi}^\pi \sin(-\pi^2/t)D_n(t)\,dt .$$
In the last integral we are integrating an odd function, namely $\sin(-\pi^2/t),$ times the even function $D_n(t).$ Since odd times even is odd, and the integration is over an interval symmetric with respect to $0,$ the integral is $0$ for every $n.$
Thus, not only do we have $S_n(f,0) \to f(0) = 1,$ we have $S_n(f,0) = f(0)$ for every $n.$
One last thing: In fact, $S_n(f,x) \to f(x)$ for all $x.$ This is because $f$ extends to a $2\pi$-periodic function on $\mathbb R$ that is differentiable on $\mathbb R \setminus 2\pi\mathbb Z.$ We've already taken care of the troublesome points in $2n\pi\mathbb Z$ (this was the argument from  the oddness of $\sin(\pi^2/t).$) At all other points $f$ is differentiable. And a well known result says that if $f'(x)$ exists, then $S_n(f,x) \to f(x).$ (This result is not too hard: It follows from an argument involving the Dirchlet kernel and the Riemann Lebesgue lemma.)

Previous hint: $\sin(\pi^2/x)$ is an odd function.
A: Since function $\sin(\pi^2/x)$ is odd the coefficients of $\cos(nx)$ are equal to $0$. The series is in the following form $$g(x)=1+a_1\sin(x)+a_2\sin(2x)+...$$
Plugging $x=0$ we get $g(0)=1$.
