Solving the functional equation $2f(x)=f(x+a_n)+f(x-a_n)$ Let $a_n$ be a sequence of strictly positive real numbers such that $\lim_{n \to \infty}a_n=0$. Find all functions $f: \mathbb{R} \to \mathbb{R}$ that admit primitives (i.e. there exists a function $F:\mathbb{R} \to \mathbb{R}$ such that $\frac{dF(x)}{dx}=f(x), \forall x \in \mathbb{R}$) and satisfy the following equality $$2f(x)=f(x+a_n)+f(x-a_n), \forall x \in \mathbb{R}, \forall n \in \mathbb{N}$$
I have already posted this question here but I got no answer.
 A: $\newcommand{\De}{\Delta}$This problem can be solved by using the Fourier transform -- cf. this previous answer.
Let us present here an elementary solution:
Letting $G_n(x):=F(x+a_n)+F(x-a_n)-2F(x)$, we get $G'_n(x)=f(x+a_n)+f(x-a_n)-2f(x)=0$ for all $x$. So,
\begin{equation*}
    c_n:=G_n(x) \tag{1}\label{1}
\end{equation*}
does not depend on $x$.
Take any real $A$ and $B$ such that $A<B$. Let $k_n:=\lfloor\frac{B-A}{a_n}\rfloor$, so that
\begin{equation*}
    k_n\sim \frac{B-A}{a_n},
\end{equation*}
$A+k_n a_n\to B$, and, by \eqref{1}, $\De_x(a_n):=F(x+a_n)-F(x)=\De_{x-a_n}(a_n)+c_n$ for all $x$, so that
\begin{equation*}
    F(A+k_n a_n)-F(A)=k_n \De_A(a_n)+\frac{k_n(k_n-1)}2\,c_n \\ 
    =(1+o(1))(B-A)\frac{\De_A(a_n)}{a_n}+\frac{1+o(1)}2\,(B-A)^2\frac{c_n}{a_n^2}, 
\end{equation*}
whence
\begin{equation*}
\frac{\De_A(a_n)}{a_n}
=(1+o(1))\frac{F(A+k_n a_n)-F(A)}{B-A}-\frac{1+o(1)}2\,(B-A)\frac{c_n}{a_n^2}. \tag{2}\label{2}
\end{equation*}
Similarly, for any real $C>B$,
\begin{equation*}
\frac{\De_A(a_n)}{a_n}
=(1+o(1))\frac{F(A+m_n a_n)-F(A)}{C-A}-\frac{1+o(1)}2\,(C-A)\frac{c_n}{a_n^2}, \tag{3}\label{3}
\end{equation*}
where $m_n:=\lfloor\frac{C-A}{a_n}\rfloor$.
The function $F$ is differentiable and hence continuous. So, $F(A+k_n a_n)\to F(B)$ and $F(A+m_n a_n)\to F(C)$. Subtracting now \eqref{2} from \eqref{3}, we get
\begin{equation}
    \frac12\,\frac{c_n}{a_n^2}\to\frac{\De_A(C-A)-\De_A(B-A)}{C-B}.
\end{equation}
It follows now by \eqref{2} that $\frac{\De_A(a_n)}{a_n}$ converges to a finite limit as well, and thus
\begin{equation}
    F(B)-F(A)=K_1(B-A)+\frac{K_2}2\,(B-A)^2
\end{equation}
for some real $K_1,K_2$ and all real $A$ and $B$ such that $A<B$.
We conclude that $F$ is a quadratic polynomial and hence $f=F'$ is an affine function. (Vice versa, any affine function $f$ satisfies your system of functional equations.)

The above proof can be simplified a bit by noting that the limit of $\frac{\De_A(a_n)}{a_n}$ exists (and equals $F'(0)$). However, the advantage of the above proof is that it shows that the conclusion that the only solutions to the system \eqref{1} of functional equations are quadratic polynomials can be reached assuming a priori only the continuity of $F$.
A: $\newcommand\de\delta$Let us also present the Fourier transform argument, assuming that $|F|$ is bounded by a polynomial, so that $F$ may be considered a (tempered) distribution (in the generalized-function sense). Let then $\hat F$ denote the Fourier transform of $F$.
Equation (1) in the other answer yields
$$c_n\de(t)=\hat G_n(t)=e^{ita_n}\hat F(t)+e^{-ita_n}\hat F(t)-2\hat F(t)
=2\hat F(t)(\cos ta_n-1),$$
where $\de$ is the delta function.
If the equality $\cos ta_n-1=0$ takes place for some real $t$ and all $n$, then $t=0$ (since the $a_n$'s are nonzero and go to $0$). So,
the support of $\hat F$ is $\{0\}$. So (see e.g. "For every compact subset $K\subseteq U$ there exist constants
$C_{K}>0$ and $N_{K}\in \mathbb {N}$ such that for all $f\in C_{c}^{\infty }(U)$ with support contained in $K$ [...]" here), we have $\hat F=\sum_{j=0}^n a_j\de^{(j)}$ for some $n\in\{0,1,\dots\}$ and some complex $a_j$'s, where $\de^{(j)}$ is the $j$th derivative of the delta function $\de$. So, $F$ is a polynomial. Since the second difference $G_n$ of $F$ is (the) constant ($c_n$), it follows that the polynomial $F$ is quadratic. Thus, $f=F'$ is an affine function. (Vice versa, any affine function $f$ satisfies your system of functional equations.)
