## Periodic functions with no minimum period

Let's start with a basic "calculus fact".

By definition of periodicity, there exists a subset $\Lambda \subset \mathbb{R}$ satisfying $f(x + \lambda) = f(x)$ for every $x\in \mathbb{R}$ and $\lambda \in \Lambda$. Necessarily $\Lambda$ is closed under addition, and hence is a subgroup of $\mathbb{R}$, therefore $\Lambda$ is either equal to $\lambda \mathbb{Z}$ or is dense in $\mathbb{R}$. (See this proofwiki entry for justification of this assertion.)

By continuity of $f$, $\Lambda$ has to be a closed set: if $\lambda_j \to \lambda$ and $f(x+\lambda_j) = f(x)$, then $f(x+ \lambda) = f(x)$. This means that if $\Lambda$ were dense, it is equal to $\mathbb{R}$. But in this case $f$ would be constant, which contradicts our assumption. So $\Lambda$ is discrete and we can take $\lambda$ to be the smallest positive element.

The theorem is no longer true if you don't assume continuity.

## Sums of periodic functions

Here's another "calculus fact"

The implication $\Leftarrow$ is immediate: if $p/q \in \mathbb{Q}$ then there exists $r \in \mathbb{R}$ such that $r = ap = bq$ with $a,b\in \mathbb{Z}$. Thus $r$ is a common period of $f$ and $g$ and hence $f+g$ is periodic with period $r$. (Note that this does not require continuity.)

For the reverse implication $\Rightarrow$, we prove by contrapositive. First, without loss of generality we can assume $p,q$ are the smallest positive periods. Suppose now $p/q$ is irrational, and let $r$ be a period of $f+g$. Then necessarily at least one of $r/p$ and $r/q$ is irrational. Without loss of generality assume it is $p$.

If $r/q$ were rational, than we can assume without loss of generality that $r$ is a multiple of $q$. This implies then that $g$ is $r$-periodic, and hence so is $f$. But then $f$ must be constant (based on Theorem 1 above).

If $r/q$ were irrational, we can assume that $p < q$ (otherwise switch $f$ and $g$). Consider $\bar{f}(x) = \int_0^p f(x+s) ds$ and $\bar{g}(x) = \int_0^p g(x+s) ds$. By construction $\bar{f}$ is constant, $\bar{g}$ is a superposition of $q$-periodic, and $\bar{f} + \bar{g}$ is $r$-periodic. However, as $\bar{f}$ is constant, we have that $\bar{g}$ must also be $r$-periodic, and thus $\bar{g}$ is both $q$ and $r$ periodic and hence is constant, which implies that $g$ has to also be $p$ periodic (by the fundamental theorem of calculus). And since $p/q$ is irrational we must have $g$ is constant.

Dropping continuity we have the following theorem

If $p/q$ is rational, then the theorem is trivial. So let us assume that $p/q$ is irrational.

Choose $r$ such that $p,q,r$ are linearly independent over the rationals. Observe that the mapping $\mathbb{Z}^3\ni (a,b,c) \mapsto ap + bq + cr$ is therefore injective, denote by $\Lambda$ the image of this mapping. Notice that if $w,y \in \Lambda$ and $z\in \mathbb{R}\setminus \Lambda$, then $w + y \in \Lambda$ and $w + z \not\in \Lambda$.

Define $f$ and $g$ such that $f = g = 0$ away from $\Lambda$, and on $\Lambda$, set \[ f(ap + bq + cr) = |b| + |c|, \qquad g(ap + bq + cr) = -|a| - |c|. \] These functions are well-defined by the injectivity property discussed above. By definition $f$ is $p$ periodic, and $g$ is $q$ periodic. But \[ (f+g)(ap + bq + cr) = |b| - |a| \] is $r$ periodic.