If $f$ is continuous on $\mathbb R$ and $f(x)=f(x+1)=f(x+\pi)$ all $x$ in $\mathbb R$ then $f$ is constant.

  • 4
    $\begingroup$ Hint: The subgroup $\mathbb{Z}+\pi\mathbb{Z}$ is dense in $\mathbb{R}$. $\endgroup$
    – Julien
    Jan 29, 2013 at 2:37
  • $\begingroup$ @julien Make that an answer!!! $\endgroup$
    – Pedro
    Jul 10, 2013 at 4:15

2 Answers 2


By Dirichlet Theorem, the set

$$\{ m+ n \pi \mid m,n \in \mathbb Z \}$$

is dense in $\mathbb R$.

It is easy to show that $f(m+ n \pi)=f(0)$ for all $n,m \in \mathbb Z$, and using the definition of continuity and denseness mentioned above you can get that $f(x)=f(0)$ for all $x \in \mathbb R$.


Assume that $f$ is nonconstant. If it is nonconstant, continuous, and periodic, it must have a least positive period, $T$ (proof of this can be found here). If $f(x) = f(x+1)$ for all $x\in\mathbb{R}$, then $T=1/m$, where $m$ is a positive integer. Also, if $f(x) = f(x+\pi)$ for all $x\in\mathbb{R}$, then $T = \pi/n$, where $n$ is a positive integer. Since it cannot be that $1/m = \pi/n$, we have a contradiction, which then implies that $f$ cannot be nonconstant.

  • 1
    $\begingroup$ The fact that there are two periods does not imply that they are rationally proportional. $\endgroup$
    – Julien
    Jul 10, 2013 at 2:04
  • $\begingroup$ If $1,\pi, a_2,a_3,\ldots$ be a basis of $\mathbb{R}$ as a $\mathbb{Q}$-vector space. Define $f(1)=f(\pi)=0$ and $f(a_i)=1$. Extend by linearity. This function is non-constant and has those periods. $\endgroup$
    – OR.
    Jul 10, 2013 at 2:07
  • $\begingroup$ @julien There aren't two periods, there is one, which, by the hypothesis of the problem, is both rational and irrational. Hence the contradiction. $\endgroup$ Jul 10, 2013 at 3:55
  • $\begingroup$ @Franklin.vp How can a function have more than one period? $\endgroup$ Jul 10, 2013 at 3:57
  • $\begingroup$ @AnonSubmitter85 your mistake in the edited answer is in assuming that a function necessarily has a smallest period. Consider the function $f_{\mathbb{Q}}$ which is 1 on rationals and 0 on irrationals; then for all $n$, $f_{\mathbb{Q}}(x+\frac{1}{n}) = f_{\mathbb{Q}}(x)$, so $f_{\mathbb{Q}}$ has no smallest period. $\endgroup$ Jul 10, 2013 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.