If $f$ is continuous integrable on $\mathbb{R}$ such that either $f(x)>0$ or $f(x)+f(x+1)>0$, then is $\int_{-\infty}^{\infty}f(x)dx>0$? 
Let $f$ be a continuous integrable function on $\mathbb{R}$ such that for each $x$, either $f(x)>0$ or $f(x)+f(x+1)>0$. Then is $\int_{-\infty}^{\infty}f(x)dx>0$ ?

Intuitively, I think this is true, because whenever on a set $A$ , $f(x)<0$ , then $\int_{A\cup A+1} f(x)dx>0$. But I do not know how to write this argument rigorously.
 A: Here is a sketch, note that the integrals below make sense since $A,B$ are open and $C$ is closed.
Let $A:=\{ x : f(x) < 0 \}$ and $B= \{ x +1 :x \in A \}$. Then, both $A,B$ are open and disjoint*( since $f(x)+f(x+1)>0$).  
Let $C:= \mathbb R \backslash (A \cup B)$. Then $A,B,C$ are pairwise disjoint, $A,B$ open $C$ closed (i.e. they are Borel if you are familiar with Borel sets) and hence 
$$
\int_{\mathbb R} f(x) d x = \int_A  f(x) d x+ \int_B  f(x) d x +\int_C  f(x) d x \\
\stackrel{t=x-1}{===}\int_A  f(x) d x+ \int_A  f(t+1) d t +\int_C  f(x) d x \\
=\int_A   \left( f(x) +f(x+1) \right)d x +\int_C  f(x) d x \\
$$
Now, each integral is $\geq 0$ thus $\int_{\mathbb R} f(x) dx \geq 0$.
If $A \neq \emptyset$ since $A$ is open and $f(x)+f(x+1)>0$ it is easy to argue using continuity that $\int_A f(x)+f(x+1) dx >0$. 
If $A =\emptyset$ then $C =\mathbb R$ and $f(x) \geq 0$ for all $x$. Now, it is easy to argue that $f$ cannot be identically zero, and by the same argument $\int_C f(x) dx >0$.
A: Let $A:=\{x\in\Bbb R: f(x)>0\}$. Because $f$ is continuous then $A$ is open and piecewise-connected (by "piecewise-connected" I mean that it is the union of countable disjoint open intervals).
WLOG suppose that $A\neq\Bbb R$. This imply that $A^\complement$ is the union of countable and closed intervals. Then $A^\complement=\bigcup_{j\in I} R_j$, for $|I|\le\aleph_0$, where $R_j\cap R_k=\emptyset$ for $j\neq k$ and each $R_j$ is a closed interval.
Now note that because $f(x)\le 0$ for each $x\in A^\complement$ then we knows that for each $R_j$ there is some (non-empty) open interval $I_j$ such that $\lambda(I_j)\ge\lambda(R_j)$, $\sup R_j=\inf I_j$ and $f|_{I_j}>0$. From here its easy to see that
$$\Bbb R=I_0\cup\left(\bigcup_{j\in I}(R_j\cup I_j)\right)$$
is a disjoint partition of $\Bbb R$ where $I_0$ could be empty, that is, each interval $I_j$ or $R_j$ is disjoint of any other interval $I_k$ or $R_k$. Hence
$$\int_{\Bbb R} f(x)\,\lambda(dx)=\\=\int_{I_0} f(x)\,\lambda(dx)+\sum_{j\in I}\int_{R_j}(f(x)+f(x+1))\,\lambda (dx)+\sum_{j\in I}\int_{H_j}f(x)\,\lambda(dx)$$
where $H_j:=I_j\setminus(R_j+1)$.
Then clearly $\int_{R_j} (f(x)+f(x+1))\,\lambda(dx)\ge 0$ for each $j\in I$ because $f(x)+f(x+1)>0$ and $\lambda(R_j)\ge 0$. Also $\int_{H_j} f(x)\lambda(dx)\ge 0$ because $\lambda(H_j)\ge 0$ and $H_j\subset A$. By last, if $I_0\neq\emptyset$ then $\lambda(I_0)>0$ and $I_0\subset A$. 
Then adding all we find that the integral is necessarily positive, because if some $\lambda(R_j)=0$ (that is, if $R_j$ is a singleton) then $\lambda(H_j)>0$, and viceversa.
