Prove that $f$ is periodic if and only if $f(a) =f(0)$. 
Suppose that $f'$ is periodic with period $a$. Prove that $f$ is periodic if and only if $f(a) =f(0)$.

I understand the direction assuming that $f(a) = f(0)$, but the other direction I don't get in the solution below. How do they get $f(na) = nf(a) - (n-1)f(0) = \dfrac{n}{n+1}[(n-1)f(a)-f(0)]$? 
The following is the solution the book gives for the second part:

Conversely, suppose that $f$ is periodic (with some period not necessarily equal to $a$).  Let $g(x)=f(x+a)-f(x)$.  Then $g'(x)=f'(x+a)-f'(x)=0$, so $g$ has the constant value $g(0)=f(a)-f(0)$.  I.e., $$f(x+a)=f(x)+f(a)-f(0)$$  It follows that $$f(na)=nf(a)-(n-1)f(0)=\frac{n}{n+1}[(n-1)f(a)-f(0)]$$  Now if $f(a)\neq f(0)$, then this would be unbounded.  But $f$ is bounded since it is periodic.


Slightly differently worded:
As $g$ is constant, we have $f(x+a)-f(x)=g(x)=g(0)$ for all $x$, hence $f(na)=f(0)+ng(0)$ by induction on $n$. If $g(0)\ne 0$, this is unbounded, whereas a continuous periodic function must be bounded. Hence we conclude $g\equiv 0$, i.e., $f(x+a)=f(x)$ for all $x$.
