prove that $f$ is periodic A function $f\colon\mathbb{R}\to(0,\infty)$ satisfies equation $f(x)=f(x+64)+f(x+1999)-f(x+2063)$. Prove that $f$ is periodic.
I'm quite sure that 1999 and 64 are random numbers (probably 1999 = year of competition) and any positive integers $p$ and $q$ would work fine.
I had an idea that in general $pq$ or $pq(p+q)$ should be a period of a positive function $f$ which satisfies $f(x+p+q)+f(x)=f(x+p)+f(x+q)$, so I tried substitutions like $x=p$, $x=q$, $\dots$, $x=pq-p$, $x=pq-q$, $x=pq-p-q$ and adding obtained equations and doing reductions using others, but it was an unsuccessful attempt. I have no idea how to use the assumption that $f$ is positive.
 A: Robjohn's approach by the theory of linear recurrence relations (along with a minor fix, see below) is the best way of understanding this problem.
For those who don't appreciate the beauty of the theory, and want a cruder / more elementary solution, consider the following:
$$ f(x ) - f(x+1999) = f( x + 64 ) - f(x+2063) = f(x+128) - f(x+2127) \\= \ldots = f(x+127936) - f(x+129935)$$
$$ f(x) - f(x+64) = f( x+1999) - f(x+2063) = f(x+3998)-f(x+4062) \\ = \ldots = f(x+127936) - f(x+128000)$$
Thus, 
$$ f(x) - f(x+127946) = f(x+64)-f(x+128000) = f (x+1999) - f(x+129935).$$
Let $g(x) = f(x) - f( x + 127946)$. Then, 
$$ g(x) = g(x+64) = g( x + 1999) = g ( x + 64 A + 1999 B) $$
Since $ \gcd(64, 1999 ) = 1$, This tells us that $ g(x) = g(x+1) = g(x+ 127946)$. Thus $ f( x + 127946n) = f(x) - n g(x) $ for all integers $n$.
If $ g(x) > 0 $, then for integer $n > \frac{ f(x) } { g(x) } $, we have $ f(x + 127946 n ) < 0 $.
If $ g(x) < 0 $, then for integer $n < \frac{ f(x) } { g(x) } $, we have $ f(x + 127946 n ) < 0 $.
Either of these statements will contradict the assumption that the image is positive (is bounded below).
Hence, we have $g(x) = 0$, or that $f(x) $ is periodic with a period of 127936.

Note: The condition that the image is bounded (either below or above) is necessary. For example, $f(x) = x$ clearly satisfies the functional equation, but is not periodic. 

Explanation of my initial comment:
As deduced from the theory of linear equations, the solution set (restricted to integers, or equivalently, those with the same fractional part) is
$$ f(n) = \alpha n + \beta + \sum \gamma_i \omega ^ {in} + \sum \delta_i \nu^{in}, $$ 
where $ \omega, \nu$ are respectively the 64th and 1999th roots of unity that are not 1.
The work that we're then required to do, is to show that $ \alpha = 0 $.
This is almost immediately obvious, since the rest of the terms are bounded, and we just need to take a sufficiently large $n$, to get $ f(n) < 0 $. 
This is why the theory of linear recurrence relations is (to me) the best way of approaching this problem. It cuts immediately to the heart of the issue, and provides clear motivation for what to do, instead of mucking around with the algebra and hoping that things work.
A: The equation given says
$$
(1-S^{64})(1-S^{1999})f(x)=0\tag{1}
$$
where $Sf(x)=f(x+1)$.
The general solution of $(1)$ is the sum of a function which has period $64$ and a function which has a period of $1999$. Since $\mathrm{lcm}(64,1999)=127936$, the sum of two such functions has period $127936$.

As Calvin Lin points out,
$$
(1-S)^2\mid(1-S^{64})(1-S^{1999})\tag{2}
$$
Furthermore,
$$
\left(x^{2063}-x^{1999}-x^{64}+1,2063x^{2062}-1999x^{1998}-64x^{63}\right)=x-1\tag{3}
$$
so $1-S$ is the only multiple factor of $(1-S^{64})(1-S^{1999})$.
However, $(2)$ implies that $(1)$ admits not only the aforementioned periodic functions, but also $f(x)=\alpha x$. The fact that $f(x)\ge0$ for all $x\in\mathbb{R}$ implies that the linear part must vanish; that is, $\alpha=0$.
Thus, we can use $f(x)\ge0$ for all $x\in\mathbb{R}$ to conclude that $f$ is periodic.
