Is there a function f: $\mathbb{R} \to \mathbb{R}$ with arbitrary small period different from $f(x) = k$? ($\forall \epsilon >0 \exists a < \epsilon $ such that f(x) has a periodicity $a$) I think the function is the Dirichlet function but I don't know how to prove it properly.

  • 2
    $\begingroup$ F(x)=1 for numbers with a halting decimal expansion, for example $3.452$ and not $1/3$ $\endgroup$
    – Empy2
    Oct 4, 2018 at 12:00
  • $\begingroup$ @Empy2 Nice: your example also works for domain $\mathbb{Q}$. $\endgroup$
    – aschepler
    Oct 4, 2018 at 12:38
  • 3
    $\begingroup$ I would avoid saying “such that the period of $f(x)$ is $a$” here. The term period would usually denote the smallest $a>0$ that fulfills $f(x+a) = f(x)$. Here you should rather just say “such that $f$ has a periodicity $a$”, or “such that $f$ is $a$-periodic”, which does assert $f(x+a) = f(x)$ but does not make any statement as to whether there exists also $b \in ]0,a[$ with $f(x+b)=f(x)$. $\endgroup$ Oct 4, 2018 at 13:55
  • $\begingroup$ Of course you want $0<a<\epsilon$ $\endgroup$
    – MPW
    Oct 4, 2018 at 18:07
  • $\begingroup$ You can construct a lot of such functions. The recipe: 1) Take any sequence $a_k$ which has infinite number of values in any neighbourhood of zero; 2) Make a set consisting of all finite sums of $a_k$ with arbitrary integer coefficients; 3) The characteristic function of this set will satisfy your requirements for $f$. If $a_k=1/k$ then you're getting rationals. If $a_k=10^{-k}$ then you're getting Empy2's set. If $a_k=k^{-\pi}$ then you're getting new set which is hard to imagine :-) If $a_k=\sin{k}$ then you're getting new interesting set. $\endgroup$ Oct 5, 2018 at 7:40

5 Answers 5


You're right. The characteristic function of the rationals is periodic of period $1/n$ for all $n \in \mathbb N$ because $x$ is rational iff $x+1/n$ is rational.


You're correct.

Let $\epsilon$ be arbitrarily small. You need to prove that there exists some $0<p<\epsilon$ such that $D(x)=D(x+p)$ for all $x\in \mathbb{R}$.

We know that $\epsilon$ is some positive real number, so there exists some $p\in \mathbb{Q}$ such that $0<p<\epsilon$. Let's look at an arbitrary $x\in \mathbb{R}$ and see if our property is satisfied or not:

If $x$ is rational, then $D(x)=1$. Since the sum of two rationals is rational, then $D(x+p)=1$ too.

If $x$ is irrational, then $D(x)=0$. Since the sum of a rational and an irrational is irrational, then $D(x+p)=0$ too.

So if we choose our period to be $p$, our property is satisfied.


The main question has been answered in other answers well enough, but I would like to address a few natural follow-up questions. What about continuous functions $f$ with this property?

It turns out that in this case there are no nontrivial solutions - every such function is constant. Here's a topological proof: Let $K=\{x\in\Bbb R\mid \forall y, f(y)=f(x+y)\}$ be the set of periods of $f$. If $f$ is continuous, then this is an intersection of the sets $\{x\in\Bbb R\mid f(y)=f(x+y)\}$, which is closed (it is the preimage of $\{0\}$ under the function $g(x)=f(y)-f(x+y)$), so $K$ itself is closed. $K$ is also dense in $\Bbb R$, because it is an additive group with arbitrarily small elements, so $K=\Bbb R$ and hence $f(x)=f(y)$ for all $x,y\in \Bbb R$.

If we consider discontinuous functions again, then we know $K$ is a dense additive subgroup of $\Bbb R$. Does every dense additive subgroup generate such a function? Yes, we can just take the characteristic function of $K$. For a fixed $K$, the space of such functions is just all functions $\Bbb R/K\to \Bbb R$. This is another way to get at the constancy result, since as a topological group, $\Bbb R/K$ has the indiscrete topology, because any open set will cover $\Bbb R$ if copied around with translations by $K$.

Of course $\Bbb R/K$ can be uncountable, for example if $K=\Bbb Q$ or any other countable subgroup. Can it be countable or finite? It can be countable assuming some choice, as observed in TomGrubb's answer. If we consider a Hamel basis $B$ of $\Bbb R$ over $\Bbb Q$, then the set of all real numbers with zero first projection is a subgroup $K$ of $\Bbb R$ for which $\Bbb R/K\simeq \Bbb Q$.

But it can't be finite (unless it is trivial). In other words, there is no coherent way to talk about real numbers being partitioned into the "even" and "odd" ones. If $\Bbb R/K$ has $n>1$ elements, then that means that every number which is a multiple of $n$ is in $K$; but every real number is a multiple of $n$, to wit, $x=n(x/n)$.


Another way to look at it is to think about the set of periods, i.e.

$$P = \{ p \in \mathbb{R} | f(x + p) = f(x) \text{ for all } x \in \mathbb{R} \}$$

Zero is clearly a member of this set no matter what f is. P is closed under addition and negation. So clearly P is a group over addition. So, if you want to find a function that has arbitrarily small periods, you want to find a subgroup of $\mathbb{R}$ that has arbitrarily small values. $\mathbb{Q}$ is the obvious choice, so the characteristic function for $\mathbb{Q}$ works, as stated in another answer.


Here's a different function with the same property (which relies on a fair bit of choice). Choose a Hamel basis for $\mathbb{R}$ over $\mathbb{Q}$ and pick a basis vector $v$. Let $f$ be the function which projects onto the $v$ coordinate. Then for any other basis vector $u$ and any integer $n$, $$ f(x+u/n)=f(x). $$ More can be found on these functions in the article "Discontinuous additive functions" by Bernardi.

  • $\begingroup$ Hope you don't mind my edit, since it's not that much choice needed for what you want. =) $\endgroup$
    – user21820
    Oct 4, 2018 at 17:10

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.