just take $f(x) = -1$ on $[-1,0]$ and $f=1$ on $(0,1]$ ! if you're looking for a continuous example (which is not necessary for the inequality to hold) then yours is just fine.
note that this is the continuous analogue of the triangular inequality $|a+b| \leq |a| + |b|$
EDIT : if you are looking for an example which is true for ALL a and b then you'll have to work with some pretty complicated function. Let's work with a function defined on [0,1] (you can extend it to $R$ by periodicity if you want to).
Choose a Cantor set $C$ which has positive but not full measure on [0,1] (look up Cantor space if you don't know what it is : roughly speaking, it is obtained by removing an interval centered at the middle of [0,1] from [0,1], then removing another interval centered at the middle of those 2 intervals, etc. and by choosing carefully the lengths of the interval removed). Set $f(x) = 1$ if $x \in C$ and -1 otherwise. ($f$ is horrible)
Then for any $a$, $b$ in [0,1 the inequality will be strict as there will be a subset X of [a,b] such that $\int_X f <0$ and $\int_{[a,b]\backslash X} f>0$ wich is essentially what you need (compensation in the left term of the inequality).