I know that if $f$ has period $k$, then $f([0,k])$ is compact, since $[0,k]$ is compact. By the weristrass theorem, the function at this interval reaches its extreme values in the interval $[0,k]$. Now, suppose the max value at $[0,k]$ at $f(c) = d$ and suppose there is a point outside $e\in[0,k]$ such that $f(e)>d$. Then, since $f$ is periodic, I can find a point in $g\in [0,k]$ such that $f(g) = e$, but since $d$ is the max value of $f[0,k]$, we have a contradiction, then $d$ must be the max, so $f$ is bounded everywhere by its maximum value.
Is my proof right?