After some calculations, I came up with this functional equation: $f(x-1)+f(x+1)=2f(x)$. I found linear function is one possible answer, but don't know how to derive it.
I don't know much about the techniques to solve this kind of equation. Can anyone help?
Edited: $f$ is a probability function, that is $0 \leq f \leq 1$, and $f$ is continuous.
You have $f(x+1)-f(x)=f(x)-f(x-1)$ and so $f(x+2)-f(x+1)$ is equal to the same value, and similarly $$f(x+n) - f(x+n-1)=f(x)-f(x-1)$$ for all integer $n$. This gives $$f(x+n) = (n+1)f(x)-nf(x-1)=n(f(x)-f(x-1)) + f(x)$$ which is linear in integer $n$, though not necessarily linear in real $x$.
If you fix the values of $f(y)$ on $[-1,1)$ then you can give a general solution using rounding and $$f(y) = \lfloor y \rfloor\left(f(y-\lfloor y \rfloor)- f(y-\lfloor y \rfloor-1)\right) + f(y-\lfloor y \rfloor)$$