If $f(x)=\int_{x-1}^x f(s)ds$, is $f$ constant? Periodic? I was thinking of periodic functions, and in particular the following type of condition:


  If a function $f:\mathbb{R}\to\mathbb{R}$ always "tends to its average", then it should be periodic.


To make things more formal, by "tending to the average" we could say something like $f(x)=\int_{x-1}^x f(s)ds$. This is only the average depending on a previous time interval of length $1$, but it seems an interesting enough property. However, the only type of functions which I could find that satisfies this property are the constant ones!


  Question: If $f:\mathbb{R}\to\mathbb{R}$ is continuous (or more generaly measurable) and $f(x)=\int_{x-1}^x f(s)ds$ for (almost) every $x\in\mathbb{R}$, then is $f$ constant (a.e.)? Periodic (a.e.)?


Here is a first try for $C^1$ functions (see edit below!): If $f$ is $C^1$ and $x$ is fixed, we can use Taylor expansion $f(s)=f(x)+O(s-x)$ (and similarly for $x-1$) to obtain
\begin{align*}
f(x+t)-f(x)&amp;=\int_x^{x+t}f(s)ds-\int_{x-1}^{x-1+t}f(s)ds\\
&amp;=\int_x^{x+t}f(x)+O(s-x)ds-\int_{x-1}^{x-1+t}f(x-1)+O(s-x+1)ds\\
&amp;=t(f(x)-f(x-1))+O(t^2),
\end{align*}
so $f'(x)=f(x)-f(x-1)$. This is obviously true if $f$ is constant, but the converse is not clear to me at the moment.



Edit: From a comment and answer below, the equation $f'(x)=f(x)-f(x-1)$ has non-periodic solutions on $\mathbb{R}\setminus\mathbb{Z}$, so this should not be the way to go for $C^1$ functions. However, even in this case it is not clear that any solution of this equation will satisfy $f(x)=\int_{x-1}^x f(s)ds$, which is the question: All I can obtain, in principle, is $f(x)-f(x-1)=\int_x^{x-1}f(s)ds-\int_{x-2}^{x-1}f(s)ds$.
Here is a typical argument using characteristic equation:

Let $\alpha \in \mathbb{C}\setminus\{0\}$ solve the equation $\alpha = 1-e^{-\alpha}$. One can indeed prove that such solution exists. One such solution is numerically given by $-2.08884 + 7.46149 i$. Then

$$ \int_{x-1}^{x} e^{\alpha t} \, \mathrm{d}t = \frac{1 - e^{-\alpha}}{\alpha} e^{\alpha x} = e^{\alpha x}, $$

hence $f(x) = e^{\alpha x}$ is one (complex-valued) solution of the equation

$$ f(x) = \int_{x-1}^{x} f(t) \, \mathrm{d}t \tag{*}$$

If one is interested in real-valued solutions only, then one can consider both the real part and the imaginary part of $e^{\alpha x}$. In particular, this tells that there exists an analytic solution of $\text{(*)}$ which is neither constant nor having real-period.



Addendum. We prove the following claim:


  Claim. There exists a non-zero solution of $\alpha = 1 - e^{-\alpha}$ in $\mathbb{C}$.


Proof. We first note that $\varphi(x) = x(1-\log x)$ satisfies $\varphi(0^+) = 0$ and $\varphi(1) = 1$. Next, let $k$ be a positive integer. Then


There exists $y \in (2k\pi, (2k+\frac{1}{2})\pi)$ such that $ \varphi(\sin(y)/y) = \cos (y) $, by the intermediate-value theorem.
Set $x = \log(\sin(y)/y)$.


We claim that $ \alpha = x + iy $ solves the equation. Indeed, it is clear that $ e^{-x}\sin y = y $ holds. Moreover,

$$ (1-x)e^x = \varphi(\sin(y)/y) = \cos(y), $$

and so, $1 - x = e^{-x}\cos(y)$. Combining altogether,

$$ 1 - \alpha = 1 - x - iy = e^{-x}\cos(y) - ie^{-x}\sin(y) = e^{-x-iy} = e^{-\alpha}. $$

Therefore the claim follows. ////

(A careful inespection shows that this construction produces all the solutions of $\alpha = 1 - e^{-\alpha}$ in the upper half-plane.)
Let
$$f(x) = \dfrac{a_0}2+\sum\limits_{n=1}^\infty\left(a_n\cos2\pi nx + a_n\sin2\pi nx\right),$$
then 
$$\int\limits_{x-1}^x f(x)\,\mathrm dx = \dfrac {a_0}2,$$
so $f(x)$ is a constant.