TITLE: Continuous function satisfying $f(x+1) = f(x)$
QUESTION [5 upvotes]: Let $f : \mathbb{R} \to \mathbb{R} $ be a continuous function and $f(x+1) = f(x)$ for
  all $x \in \mathbb{R}$. Then

$f$ is bounded above, but not bounded below.
$f$ is bounded above and bounded below, but may not attain its bounds.
$f$ is bounded above and bounded below, and attain its bounds.
$f$ is uniformly continuous.


I have answered that 3 and 4 are correct.
Reason: We can see the image of $f$ depends on the image of $[0,1]$ under $f$.
Now , since $f$ is continuous and $[0,1]$ is a closed and bounded interval therefore $f$ is uniformly continuous on it and hence uniformly continuous on the whole of $\mathbb{R}$.
Also $f$ being continuous will attain its bound on the closed and bounded interval $[0,1]$ and the since the image of $f$ is in some sense same as image of $[0,1]$ under $f$ , therefore the bounds of $f$ on $\mathbb{R}$ will be same as that in $[0,1]$
Is this reasoning correct? 
Thanks in advance!

REPLY [2 votes]: A proof for 4.
Let $[x]$ denote the integer closest to $x$.
Since $f$ has period $1$, $\forall p\in \mathbb Z, f(x+p) = f(x)$.
Since $f$ is continuous over $[-1,1]$, it is uniformly continuous over $[-1,1]$.

Let $\epsilon >0$.
By uniform continuity of $f$ over $[-1,1]$, there is some $\delta>0$ such that $$|x|\leq 1, |y|\leq 1, |x-y|\leq \delta \implies |f(x)-f(y)|\leq \epsilon$$
Let $\gamma =\min(\frac 12, \delta)$.
Consider $x$ and $y$ two real numbers such that $|x-y|\leq \gamma$. Without loss of generality assume that $x<y$.
Note that $|f(x)-f(y)| = |f(x-[x])-f(y-[x])|$
By definition of $[x]$, $$|x-[x]|\leq \frac 12 \leq 1$$
and $$|y-[x]|\leq|y-x| + |x-[x]|\leq \gamma  + \frac 12 \leq \frac 12 + \frac 12 = 1$$
Moreover, $$|(x-[x]) - (y-[x])| = |x-y| \leq \gamma \leq \delta$$
Using uniform continuity of $f$ over $[-1,1]$ with $(x-[x])$ and $(y-[x])$ yields $$|f(x-[x])-f(y-[x])|\leq \epsilon$$
Hence $|f(x)-f(y)|\leq \epsilon$.

Putting everything together, $$\forall \epsilon > 0, \exists \gamma >0, \forall x,y, |x-y|\leq \gamma \implies |f(x)-f(y)|\leq \epsilon$$

3. is true as well, quite simple to prove formally.