The series formula f(x)=∑n=1∞4nπsin(nπx) does not reproduce the function f(x)={−1,1,−1<x<00<x<1. It is the series for another function. Didn't you make the plot?
f(x)=∑n=1∞4nπsin(nπx)
f(x)={−1,1,−1<x<00<x<1
Could you explain to me please why the F(x) is wrong?
Your formula for f[x] is wrong. Try plotting the result:
f[x]
Sum[4/(n Pi) Sin[n Pi x], {n, 1, Infinity}] Plot[Chop[%], {x, -1, 1}]