Defn: Let $f$ be a function from $\mathbb{R}$ into a set $X$. We say that $f$ is periodic if there exists $p>0$ such that for all $x\in \mathbb{R}$, we have $f(x+p)=f(x)$.
Prove: If $f$ is a continuous periodic function from $\mathbb{R}$ into a metric space $M$, then $f$ is uniformly continuous on $\mathbb{R}$.
Attempt: I think I can use the fact that for all $x \in \mathbb{R}$, $[x,x+p]$ is a closed and bounded interval. Then $f$ is compact and hence uniformly continuous on the interval.
I also tried considering $[0,p]$. In that case, $x = np+\alpha$ and $y = mp + \beta$ for some $m,p \in \mathbb{Z}$ and $\alpha,\beta \in \mathbb{R}$. If $n<0$, then we can choose $\alpha \in \mathbb{R^\mathbf{-}}$, so that $f(np+\alpha)=f(|\alpha|)$ and not $f(1-\alpha)$. Hope that makes sense.
Then $\alpha,\beta \in [0,p]$, and I can find a $\delta$ that works for all $\alpha, \beta$ in $[0,p]$. The problem is, I need to constrain $|x-y|$ and somehow get that $|\alpha-\beta| < \delta$. So far I haven't figured out how to do this.
Been furrowing my brow at this for a while.. any hints very welcomed...
Thanks