TITLE: Does a periodic function have to be bounded?
QUESTION [6 upvotes]: Let a function $f$ satisfy the relation $f(x)=f(x+1)$ for all $x\in \Bbb{R}$. Should this function always be bounded?
I think so, but the book doesn't. Any help will be greatly appreciated. Please note that the function need not be continuous.

REPLY [8 votes]: Just to add another example that has period $1$ and is unbounded on every open interval:
$$f(x)=\begin{cases}\min\{\,n\in\mathbb N:nx\in\mathbb Z\,\}&\text{if $x\in\mathbb Q$}\\0&\text{otherwise}\end{cases} $$

REPLY [4 votes]: Take the function $g:[0,1)\to\mathbb{R}^+$ whose value is $1$ on the irrational numbers and $q$ for any rational number of the form $\frac{p}{q}$ with $\gcd(p,q)=1$, then define $f(x)$ as $g(\{x\})$. Since $g$ is unbounded, $f$ is unbounded, too.