Need example of Riemann Integrable function f: [-1,1] -> R which:
1) Integral from -1 to 1 = 1
2) Integral from -1 to 0 = -1
3) Integral from -1 to 1 of absolute value of f(x) = 2
Any help would be much appreciated as I couldn't come up with any. Is there some kind of easy way to find function which meet said requirements?
One possible way would be to define $f$ to be constant on each of the intervals $[-1,-1/2), [-1/2,0), [0,1/2), [1/2,1]$, so that
$f(x)\ge0$ on $[-1,-1/2), [0,1/2)$, and
$f(x)\le0$ on $[-1/2,0), [1/2,1]$, and
$\int_{-1}^{-1/2} f(x) dx = a\ge 0$,
$\int_{-1/2}^{0} f(x) dx = -b\le 0$,
$\int_{0}^{1/2} f(x) dx = c\ge 0$,
$\int_{1/2}^{1} f(x) dx = -d\le 0$,
and then solve the system
$a+c-b-d=1$
$a-b=-1$
$a+c+b+d=2$.
Given there are four variables and only three equations, you could simplify this idea further (e.g. just take $d=0$). Then $a=1/4, b=5/4, c=1/2$ works.