5.8 How to plot a function?

Here, I am looking at Fourier series expansion of \(f(x)=0\) between \(–\pi \) and 0, and \(f(x)=1\) between 0 and \(\pi \).

The Fores series expansion is worked out to be as below. This shows that the series approximate the above \(f(x)\) as more terms are added

restart; 
f:=(x)-> 1/2 + (1/Pi)*(sin(x)+sin(3*x)/3+sin(5*x)/5+sin(7*x)/7); 
plot(f(x),x=-10..10);