Fourier series is quite a new concept for me and I'm not sure if I understand them correctly.
I am given a function $f:[-\pi, \pi] \to \mathbb{R} $ defined by
$$ x\mapsto \begin{cases} 0 & \text{if $-\pi \le x \le -\pi /2$} \\ 1 & \text{if $-\pi/2 \lt x \le \pi /2$} \\ 0 & \text{if $\pi/2 \lt x \le \pi$} \end{cases} $$
the function is extended periodically to the whole of $ \mathbb{R} $, and has the Fourier series, $S_f(x)$. And I am supposed to evaluate $S_f(\frac{\pi}{2})$, and this is the part I am struggling with. So far I have found that the Fourier series for this function is (I might be wrong though): $$S_f(x)= \frac{1}{2}+\sum_{n=1}^\infty \frac{2}{\pi n} \sin\Big(\frac{\pi n}{2}\Big) \cdot \sin(nx) $$ but after this part, I am stuck.
By Dirichlet's theorem, the answer is $\frac{f\left( \left(\frac{\pi}{2}\right)^+\right) + f\left( \left(\frac{\pi}{2}\right)^-\right)}{2}=\frac12$.
But let's verify it, you made a minor mistake in your series expression, rather than sines, it should be cosines.
$$S_f(x)= \frac{1}{2}+\sum_{n=1}^\infty \frac{2}{\pi n} \sin\Big(\frac{\pi n}{2}\Big) \cdot \color{red}\cos(nx) $$
Hence
$$S_f\left(\frac{\pi}{2}\right)=\frac{1}{2}+\sum_{n=1}^\infty \frac{2}{\pi n} \sin\Big(\frac{\pi n}{2}\Big) \cdot \cos\left(\frac{n\pi}2\right) =\frac{1}{2}+\sum_{n=1}^\infty \frac{\sin\left(n\pi\right)}{\pi n} =\frac12 + 0=\frac12$$