Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
Hint: The subgroup $\mathbb{Z}+\pi\mathbb{Z}$ is dense in $\mathbb{R}$. – 1015 Jan 29 '13 at 2:37
@julien Make that an answer!!! – Pedro Tamaroff Jul 10 '13 at 4:15
up vote 6 down vote accepted

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$.

share|cite|improve this answer

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.

share|cite|improve this answer
The fact that there are two periods does not imply that they are rationally proportional. – 1015 Jul 10 '13 at 2:04
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. – Mlazhinka Shung Gronzalez LeWy Jul 10 '13 at 2:07
@julien There aren't two periods, there is one, which, by the hypothesis of the problem, is both rational and irrational. Hence the contradiction. – AnonSubmitter85 Jul 10 '13 at 3:55
@Franklin.vp How can a function have more than one period? – AnonSubmitter85 Jul 10 '13 at 3:57
@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. – Steven Stadnicki Jul 10 '13 at 4:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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