Let $f : \Bbb R \rightarrow \Bbb R$ be a func such that $p>0$, that $f(x+p) = f(x)$ for all $x \in \Bbb R$ . Show that $f$ has an absolute max and min Problem: Let $f : \Bbb R \rightarrow \Bbb R$ be a contiunous function such that for some real number $p>0$, $f(x+p) = f(x)$ for all $x \in \Bbb R$. Show that $f$ has an absolute max and min.
Thoughts:
By rolle's theorem, I know that between $f(x+p)$ and $f(x)$ there has to be a local minimum if $f$ is differentiable on this open interval, but I am outright confused by the precise statement of the question, and in fact I have included an image which may be a counter-example if the question has not been stated properly(sorry for the crudeness of the image) assuming the function continues in this manner infinitely 
Edit: As per a comment, since $f$ is not shown to be differentiable on this interval, then Rolle's theorem does not apply. 
Also see my answer for a response to my initial confusion.
 A: Recall that if a real-valued function $g(x)$ is continuous on a closed and bounded interval $[a,b]$, then it has a global maximum and minimum on $[a,b]$.
And since $f(x)$ is periodic with period $p$, it follows that $f$ is determined by its values on $[0,p]$. Therefore the global maximum for $f$ on $[0,p]$ is a global maximum for $f(x)$ on $\mathbb{R}$.
A: HINT
You're on the right track using Rolle's theorem since usually, whenever the derivative is zero a (local) maximum or minimum is expected. However, this is not guaranteed, and moreover, as @Jonas pointed out, this requires the function to be differentiable, which we don't know in advance. Instead, use the following theorem

A continuous function defined on a closed interval always reaches its maximum and minimum value.

I leave you a hint for the next step below, but I encourage you to try it on your own before taking a look at it :)

 The idea is to apply this theorem on the interval $[0,p]$, then you get local min and max. Can you show these are actually global?

A: Theorem: Any continuous map on a closed interval has a max and a min. 
Apply this to the interval $[0,p]$. Since for any $x \in R$ we have some $x_0 \in [0,p]$ such that $f(x)=f(x_0)$, the maximum on that sub-interval is in fact a global max.
Note: No differentiability assumption was made.
