Problem:
(a) Let $f(x)=\begin{cases} 1, & \text{if $-\pi\le x\lt0$ } \\ 0, & \text{if $0\le x\lt\pi$ } \end{cases}$ Show that it's Fourier series is $\frac12+\frac1\pi\sum_{n=1}^\infty\frac{((-1)^n-1)}{n}\sin(nx).$
(b) Explain why this series converges in mean to $f$.
(c) What can you say about the pointwise and uniform convergence of this series?
(d) Why are the coefficients of the cosine terms all zero?
Attempt:
(a), (d): Recall that the Fourier Series is given by: $f(x)=\frac{a_0}2+\sum_{k=1}^\infty(a_k\cos(kx)+b_k\sin(kx))$ where $k\in\mathbb N$. Here, $a_k$ and $b_k$ are given by $\frac1\pi\int_{-\pi}^\pi f(x)\cos(kx)dx$ and $\frac1\pi\int_{-\pi}^\pi f(x)\sin(kx)dx$ respectively.
Notice that for $a_k$ we have that:
$$a_k=\frac1\pi\int_{-\pi}^\pi f(x)\cos(kx)dx=\frac1\pi\int_{-\pi}^0 \cos(kx)dx+0=\frac1\pi[\frac1k\sin(kx)]_{-\pi}^0=0$$
Which highlights why the coefficients of the cosine terms are all zero. As such, our Fourier Series will be given in terms of sine functions. We now determine $b_k$.
$$b_k=\frac1\pi\int_{-\pi}^\pi f(x)\sin(kx)dx=\frac1\pi\int_{-\pi}^0 \sin(kx)dx=\frac1\pi\left[-\frac1k\cos(kx)\right]_{-\pi}^0=\frac1\pi\left(-\frac1n+\frac{(-1)^n}{n}\right)$$
Now, $a_0$ is given by $\frac1\pi\int_{-\pi}^\pi f(x)dx=1$. So that on putting this all together we do indeed get that the Fourier Series is given by:
$$\frac12+\frac1\pi\sum_{n=1}^\infty\frac{((-1)^n-1)}{n}\sin(nx)$$
(b),(c): Here is where I am running into difficulty, and am unsure whether or not the approach I am taking is the right one.
For (b) I think I should compute $\|(\frac12+\frac1\pi\sum_{n=1}^\infty\frac{((-1)^n-1)}{n}\sin(nx))-1\|_2^2$ and then $\|(\frac12+\frac1\pi\sum_{n=1}^\infty\frac{((-1)^n-1)}{n}\sin(nx))-0\|_2^2$ for when $x\in[-\pi,0)$ and $x\in[0,\pi)$ respectively, and show that they approach zero in each case. Besides needing to confront the square of a an infinite sum in each case, it seems that I am left with an overhanging $\frac12$ in each case? Where am I going wrong?
For (c) I am not too sure, being quite rusty. What tests should I be using the test the different convergences of this series? Does establishing (b) firstly let me deduce something about these two other modes of convergence?
Assuming that by "convergence in mean" you mean "convergence in $L^2$", that's given by Riesz-Fischer in general. So, you don't have to work with your particular example, you just need to find the Fourier coefficients (which you did).
The Dirichlet-Dini Criterion shows that the series converges to $f$ at all points other than $0$ and the end points.
Since $f$ is not continuous, the convergence cannot be uniform (because a uniform limit of continuous functions is continuous).