I posted a very similar exercise a few days ago. I think this one is a bit easier.

Let $\displaystyle f(t)=0$ if $\displaystyle - \pi < t \leq 0$, $\displaystyle 1$ if $\displaystyle 0<t \leq \pi$.

1)Calculate $\displaystyle \hat f (n)$ for all $\displaystyle n \in \mathbb{Z}$.

2)Calculate $\displaystyle \sum _{n=-\infty}^{\infty} |\hat f (n)|^2$.

3)Study the pointwise convergence of the Fourier series of f.

Attempt: 1)For all $\displaystyle n \neq 0$, I get that $\displaystyle \hat f(n)=\frac{i(-1)^n}{2 \pi n}$. For $\displaystyle n=0$, $\displaystyle \hat f(0)=\frac{1}{2}$ which is consistent with the average of the right and left limit of the function at $\displaystyle t=0$.

2)$\displaystyle \sum _{n=-\infty}^{\infty} |\hat f (n)|^2 =||f||^2 = \lim _{N \to \infty} ||S_N f||^2+ ||f- S_N f||^2=\frac{1}{2 \pi} \int _{-\pi}^{\pi} |f(t)|^2 dt$. So I think I should calculate the Fourier series of f.

It gave me $\displaystyle f(t)=\frac{1}{2}+ \sum _{n=-\infty}^{-1} \frac{i(-1)^n}{2 \pi n} \left [ \cos (tn) - i \sin (tn) \right ] + \sum _{n=1}^{+\infty} \frac{i(-1)^n}{2\pi n} \left [ \cos (tn) - i \sin (tn) \right ]$.

So that $\displaystyle ||S_N f||^2 =\frac{1}{2\pi} \int _{- \pi}^{\pi} \left | \sum _{n=-N} ^{n=N} _{n \neq 0} \frac{i(-1)^n}{2 \pi n} + \frac{1}{2} \right | ^2$.

The algebra really get messy... Too messy. I suppose there is an easier way to solve the question.

3)Maybe I should use theDirichlet–Dini Criterion (that I found in Convergence of Fourier series - Wikipedia, the free encyclopedia).But we never studied it, so I'm guessing there's another way.

Edit: For 2), if I plug directly the expression of $\displaystyle \hat f (n)$ into the infinite series, it diverges since I fall over 2 harmonic series.