If a process is periodic on average with mutually incommensurable periods, is the process a martingale? Motivation:
If a continuous function on the real line is periodic with periods $p_1, p_2 > 0$ such that $\frac{p_1}{p_2}$ is irrational, then the function is constant. Is there a probabilistic analogue of this statement?
Problem set up:
Let $X$ be a continuous stochastic process with $X_t$ in $L^1$ for all $t \in [0, \infty)$. Denote by $\mathcal F_t$ its natural filtration.
Suppose there exist $p_1, p_2 > 0$, with $\frac{p_1}{p_2}$ irrational such that for all $t \in [0, \infty)$, $E[X_{t + p_i}| \mathcal F_t] = X_t$,  for each $i = 1, 2$.

Question: Is $X$ an $\mathcal F_t$-martingale?

 A: Yes, it is. For each $t$, let $S_t$ be the set of those $s \geqslant t$ for which $X_t = \mathbb E(X_s | \mathcal F_t)$. By assumption (and induction), for all $k, n \geqslant 0$ such that $k p_1 - n p_2 \geqslant 0$ we have
\[ X_t = \mathbb E(X_{t + k p_1} | \mathcal F_t) \qquad \text{and} \qquad X_{t + k p_1 - n p_2} = \mathbb E(X_{t + k p_1} | \mathcal F_{t + k p_1 - n p_2}) , \]
and therefore
\[ X_t = \mathbb E(X_{t + k p_1} | \mathcal F_t) = X_t = \mathbb E(\mathbb E(X_{t + k p_1} | \mathcal F_{t + k p_1 - n p_2}) | \mathcal F_t) = \mathbb E(X_{t + k p_1 - n p_2} | \mathcal F_t) . \]
In other words, $S_t$ contains $t + k p_1 - n p_2$ for every $k, n \geqslant 0$ such that $k p_1 - n p_2 \geqslant 0$. Plus, of course, $S_t$ is closed. We conclude that $S_t = [t, \infty)$, as desired.

Edit: As pointed out in the comment, pathwise continuity of $X_t$ need not imply $L^1$-continuity, so it is not clear that $S_t$ is closed.
So let us take a slightly different path. Define
\[T = {k p_1 - n p_2 : k, n \geqslant 0} \cap [0, \infty) .\]
We already know (by the first paragraph of this answer) that $(X_t : t \in T)$ is a martingale with respect to $\mathcal F_t$. By Doob's regularisation theorem (or strictly speaking, by the argument used in the proof of this result), there is a right-continuous martingale $(\tilde X_t : t \in [0, \infty))$ such that (almost surely)
\[ \tilde X_t = X_t \qquad \text{for all } t \in T . \]
But $(X_t : t \in [0, \infty))$ is right-continuous, too, and hence necessarily (almost surely)
\[ \tilde X_t = X_t \qquad \text{for all } t \in [0, \infty) . \]
Thus, $X_t$ is indeed a martingale.
