The proof $f(x + p) = f(x) \Rightarrow f'(x + p) = f'(x)$ can be done by simply applying the definition of the derivative and then using $f(x + p) = f(x)$. I am trying to prove the statement in the other direction, also by using the definition of the derivative.
Prove $f'(x + p) = f'(x) \Rightarrow f(x + p) = f(x)$
If $f'(x + p) = f'(x)$, then by the definition of the derivative
$\lim_{c\to0}\dfrac{f(x+p+c)-f(x+p)}{c}=\lim_{c\to0}\dfrac{f(x+c)-f(x)}{c}$ (1)
$\lim_{c\to0}\dfrac{f(x+p+c)-f(x+c)+f(x) - f(x+p)}{c}=0$ (2)
If $f(x) - f(x+p) = \lambda \ne \lambda(c) \ne 0$ then
$\lim_{c\to0}\dfrac{f(x)-f(x+p)}{c} = \pm\infty$ (3)
(3) inserted into (2) leads to
$\lim_{c\to0}\dfrac{f(x+p+c)-f(x+c)}{c} \pm \infty =0$ (4)
Whatever the result of the limit in (4), the left hand side will either be indetermined or it will invalidate (2), and therefore (1). So, $\lambda = 0 = f(x) - f(x+p) \Rightarrow f(x + p) = f(x)$.
I believe there is an error in the proof, is there one?
Let $f(t)=t$. Then $f'$ is periodic but $f$ is not.