The Key idea is what each extention represents.
Cosine is an even extention on (-L,L)
so $\displaystyle f(-x)=f(x)$ and since a fourier sereis is peroidic and even we get
$\displaystyle f\left(\frac{3}{2}L \right)=f\left( -\frac{L}{2}\right) = f\left( \frac{L}{2}\right)=\frac{L}{2}$
Sine is an odd extention on (-L,L)
so $\displaystyle f(-x)=-f(x)$ and since a fourier sereis is peroidic and odd we get
$\displaystyle f\left(\frac{3}{2}L \right)=f\left( -\frac{L}{2}\right) = -f\left( \frac{L}{2}\right)=-\frac{L}{2}$