Let the function $f\colon \mathbb{R} \to\mathbb{R}$ have arbitrarily small positive periods, in the sense that if $\delta>0$ then there exists $T \in (0,\delta)$ such that $f(t + T) = f(t)$ for all $t \in \mathbb{R}$.
(i) Prove that if $f$ is continuous then $f$ is constant.
(ii) What if $f$ is not assumed to be continuous?
(i) For each $n$, there is $0<T_n<n^{—1}$ such that $f(x+T_n)=f(x)$ for $x\in \Bbb R$. We can show that $f$ is uniformly continuous on $[0,T_n]$. So fix $\varepsilon>0$, and $n$ such that if $x\in [0,T_n]$, then $|f(x)-f(0)|<\varepsilon$. Let $x\in \Bbb R$. Write it as $N_nT_n+c_n$, where $N_n$ is an integer and $c_n\in (0,T_n)$. Then $$|f(x)-f(0)|=|f(c_n)-f(0)|\leqslant \varepsilon.$$ As it's true for all $x$ and all $\varepsilon$ we get that $f(x)=f(0)$ for all $x\in\Bbb R$.
(ii) A counter-example is the characteristic function of rational numbers.