Let $f \colon [0,1] \rightarrow {\mathbb R}$ be a nice function -- real-analytic, or maybe definable in some o-minimal structure, let's say.  Let $0 < \alpha_1 < \cdots < \alpha_n < 1$ be its roots in the open interval $(0,1)$.  Define $\alpha_0 = 0$ and $\alpha_{n+1} = 1$ for convenience.  For $0 \leq j \leq n$, let $w_j = \alpha_{j+1} - \alpha_j$.  So $sgn(f(x))$ is constant on the intervals $(\alpha_j, \alpha_{j+1})$, which have widths $w_j \leq 1$.  

For all $0 \leq j \leq n$, define a new function $f_j \colon [0,1] \rightarrow {\mathbb R}$ by the formula
$$f_j(x) = w_j \cdot f( w_j x + \alpha_j),$$
or 
$$f_j(x) = w_j \cdot f( \alpha_{j+1} - w_j x),$$
according to whether $j$ is even or odd.

These are cooked up so that
$$\int_0^1 f_j(x) dx = \int_{\alpha_j}^{\alpha_{j+1}} f(x) dx.$$
(The whole parity dependence is cooked up so that some pointy bits line up in the end.)

Define $\Xi f(x) = \sum_{j=0}^n f_j(x)$, because the letter $\Xi$ looks like a bunch of slices.  Thus
$$\int_0^1 f(x) dx = \int_0^1 \Xi f(x) dx.$$

It seems, from a few experiments, that repeating this process eventually (typically quickly) leads to a function $F(x) = \Xi^k f(x)$ for which $F(x) \geq 0$ for all $x \in [0,1]$ or for which $F(x) \leq 0$ for all $x \in [0,1]$.  Then it becomes trivial to compare the integral $\int_0^1 f(x) dx = \int_0^1 F(x) dx$ to zero.

I'd like to prove this, at least for a nice class of functions.  To put my cards on the table, I'd like to prove this for rational functions (without poles on the interval) with some explicit bounds on how many iterations are necessary.. because that might give results related to Baker's Theorem, decidability of periods in the simplest cases, etc.

If you like pictures, here's the process, exhibited for the function $f(x) = x - sin \left( \frac{1}{x + 0.02} \right)$.  I just wanted something wiggly :)  The top graph shows the function $f$ (with area shaded between $f(x)$ and the x-axis), and the graph of $\Xi f$.  Then $\Xi f$ and $\Xi^2 f$ in the graph below.  Etc.  Stabilization occurs when the graph of $\Xi^k f$ (on $(0,1)$) is always above or always below the x-axis.

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/aDppG.png