Let $f:\mathbb{R}\rightarrow \mathbb{R}$, where $f(x)=1$ if $x$ is rational number and $0$ if $x$ is irrational number. Is $f$ a periodic function.
A hour ago, in this post, I said that this function is not periodic, then Kenny Lau told that I am wrong. He also said that "well, any rational number is a period... $f(x+r)=f(x)$ if $r\in\mathbb{Q}$".
Now, I am totally confused about periodic functions. It means there must infinitely many periods.
It would be very helpful if someone explain it elaborately.
A periodic function doesn't necessarily have a minimal period. As long as it repeats itself ($\exists c>0: \forall x \in \Bbb R: f(x+c) = f(x)$), then it is periodic.