I am suppose to determine the Fourier series of a piecewise-defined function $f(x) = 1$ for $x \in [0, \frac{\pi}{2})$ and $f(x) = 0$ for $x\in [\frac{\pi}{2}, \pi)$ and find out if this Fourier series converges to what function (if it actually converges).
I started with computing my series and obtained $$F = \frac{1}{2} \sum_{k=1}^n \frac{\pi}{2k}(\cos(kx) + \sin (kx)).$$
The first question arise here: since the period of my function is $[0,\pi]$ instead of a $2\pi$ period, I computed my Fourier coefficients with slightly adjusted formulas $$a_0 = \frac{1}{\pi}\int_{0}^\pi f(x)dx, \quad a_k = \frac{\pi}{2} \int_0^\pi f(x)\cos(kx)dx, \quad b_k = \frac{\pi}{2}\int_0^\pi f(x)\sin(kx)dx$$ in which I am not sure if I should make these adjustments for $a_k$ and $b_k$.
Then it comes to determining the convergence; I looked up another Fourier post on StackExchange and the answer suggested finding the periodic extension.
However my class readings or lectures did not really cover or mention anything related to periodic extension, and I am wondering if there is another way to determine the convergence and find the function?