# Are there continuous functions $f: \mathbb{R} \to \mathbb{R}$ with irrational period such that $|\{f(n) | n \in \mathbb{N} \}| < \infty$?

In the book Mathematical Olympiad Problems, Titu Andreescu gives the following problem (roughly paraphrased):

Show that if $f: \mathbb{R} \to \mathbb{R}$ is periodic and $\{ f(n) | n \in \mathbb{N}\}$ is infinite, then the period of $f$ is irrational.

The proof is easy: if $f$ has period $p/q$ with $p, q \in \mathbb{N}$, then $f(n)$ is determined by $n \bmod p$ and $| \{f(n) | n \in \mathbb{N} \}| \leq p$. The converse, though, is more interesting. Given a function $f$ with irrational period $\alpha$ that satisfies certain other conditions, must $\{ f(n) | n \in \mathbb{N}\}$ be infinite? The conditions include, of course, that $f$ take an infinite number of values on $\mathbb{R}$, but even that allows counterexamples like $$f(x) = \begin{cases} 0 & (\exists k \in \mathbb{Z}) (x + \alpha k \in \mathbb{Z}) \\ \sin (2\pi x/\alpha) & \text{otherwise} \end{cases}$$ so I think it would be an interesting to look only at continuous (and of course nonconstant) functions $f$.

Conjecture 1: If $f$ is continuous, nonconstant, and has irrational period $\alpha$, then $|\{f(n) | n \in \mathbb{N}\}| = \infty$.

This would be implied by the following conjecture:

Conjecture 2: Any continuous nonconstant function $f: S^1 \to \mathbb{R}$, where $S^1$ is the circle, takes an infinite number of values on any countable dense subset of $S^1$.

This latter conjecture seems intuitively obvious, but I'm not sure how to go about proving it; are there Weierstrass-like pathological counterexamples? How many more conditions would be required on $f$ for either conjecture to hold?

• Conjecture 2 is easy: If $D \subset S^1$ is dense, then $f (S^1) \subset \overline {f (D)}$. Since the left-hand side is infinite, so is the right-hand side. But the closure of a finite set is the set itself (and hence finite), i. e. , $f (D)$ must be infinite. – PhoemueX Apr 11 '17 at 14:16
• This first follows from the result that if $\alpha$ is irrational then the set $$\left\{a+b\alpha\mid a,b\in\mathbb Z\right\}$$ is dense in $\mathbb R$. – Thomas Andrews Apr 11 '17 at 14:17
• The second is true by the intermediate value theorem. If $f(a)=x_1$ and $f(b)=x_2$ then $f$ must take all values between $x_1$ and $x_2$ if $f$ is continuous. – Thomas Andrews Apr 11 '17 at 14:20
• @PhoemueX: Looks like an answer. – Jonas Meyer Apr 11 '17 at 16:19