Suppose f(x)>0 for all x in [−1,1]. Then 21∫−11f(x)dx>21∫−110dx=0. That is, the average value of f(x) on the interval [−1,1] is not zero–it's something greater than zero.
Suppose f(x)<0 for all x in [−1,1]. Then 21∫−11f(x)dx<21∫−110dx=0. That is, the average value of f(x) on the interval [−1,1] is not zero–it's something less than zero.
So, if the average value of f(x) is zero, then f(x)≥0 for some x in [−1,1], and f(y)≤0 for some y∈[−1,1]. Since f is a continuous function, and 0 is between f(x) and f(y), by the intermediate value theorem (Theorem 1.6.12 in the in the CLP-1 text) there is some value c between x and y such that f(c)=0. Since x and y are both in [−1,1], then c is as well. Therefore, no function exists as described in the question.