I am reading "A Course in Analysis vol. 4" (in Japanese) by Kazuo Matsuzaka.
The author uses the following proposition without a proof in this book.
I think this proposition is intuitively obvious.
And I proved this proposition as follows.
This proposition is very simple, but my proof is not elegant.
Please give me a simple and natural and elegant proof of this proposition.
Proposition:
Let $f$ be a continuous function defined on $\mathbb{R}$ such that $f(x) = f(x+2\pi)$ for all $x\in\mathbb{R}$.
Then, $f$ is a uniformly continuous function on $\mathbb{R}$.
Proof:
$f$ is continuous on $[-\pi,3\pi]$.
So, $f$ is uniformly continuous on $[-\pi,3\pi]$.
So, if $\epsilon$ is an arbitrary positive real number, then there exists a positive real number $\delta$ such that $$x,y\in[-\pi,3\pi]\text{ and }|x-y|<\delta \implies |f(x)-f(y)|<\epsilon.$$
(1) In the case $2\pi<\delta$.
Suppose that $x,y\in\mathbb{R}$ and $|x-y|<\delta$.
There exists an integer $m$ such that $x-2m\pi\in[-\pi,\pi]$.
There exists an integer $n$ such that $y-2n\pi\in[-\pi,\pi]$.
Since $x-2m\pi,y-2n\pi\in[-\pi,3\pi]$ and $|(x-2m\pi)-(y-2n\pi)|\leq 2\pi<\delta$, $|f(x)-f(y)|=|f(x-2m\pi)-f(y-2n\pi)|<\epsilon$.
(2) In the case $\delta\leq 2\pi$.
Suppose that $x,y\in\mathbb{R}$ and $|x-y|<\delta$.
If $x=y$, then $|f(x)-f(y)|=0<\epsilon$.
If $x\ne y$, we can assume that $x<y$ without loss of generality.
Then, $0<y-x<\delta\leq 2\pi$.
There exists an integer $n$ such that $x-2n\pi\in[-\pi,\pi]$.
$-\pi\leq x-2n\pi<y-2n\pi<(x+2\pi)-2n\pi=(x-2n\pi)+2\pi\leq 3\pi$.
Since $x-2n\pi,y-2n\pi\in[-\pi,3\pi]$ and $|(x-2n\pi)-(y-2n\pi)|=|x-y|<\delta$, $|f(x)-f(y)|=|f(x-2n\pi)-f(y-2n\pi)|<\epsilon$.
$f$ factorises as $\mathbb{R}\overset{\pi}\rightarrow \mathbb{R}/2\pi \mathbb{Z} \overset{\tilde {f}}{\rightarrow}\mathbb{R}$. Note that$\mathbb{R}/2\pi \mathbb{Z}$ can be given a metric structure compatibile with the quotient structure and that with such a metric $\pi$ is uniformly continuous. Since $\mathbb{R}/2\pi \mathbb{Z}$ is compact and $\tilde f$ is continuous, $\tilde f$ is uniformly continuous. The result then follows since $f=\tilde f\circ \pi$ is a composition of uniformly continuous functions.