Dividing the interval into $\rm\,n\,$ equal pieces. [Spivak - Calculus, Exercise 20] I was doing exercise 20 of Spivak Calculus, it says

(a) Find a function $\rm\,f\,$, other than a constant function such that $$\rm\,|f(x)-f(y)|\le|y-x|\,$$
  (b) Suppose that $\rm\,f(y)-f(x)\le(y-x)^2\,$ for all $\rm\,x\,$ and $\rm\,y\,$. (Why does this imply that $\rm\,|f(y)-f(x)|\le(y-x)^2\,$?) Prove that $f$ is a constant function. Hint: Divide the interval from $\rm\,x\,$ to $\rm\,y\,$ into $\rm\,n\,$ equal pieces.

I could do (a) without much problem. But for (b) I couldn't do it after hours thinking. so i look up in the solution book

I can't understand how he goes to the green. (what's the intuition?) For the first inequality it's easy to see because $$\rm|\sum_i a_i|\le\sum_i|a_i|$$ but then how does he go to the orange part? And how he goes to the yellow part? (riemann sums aren't introduced in that part). Also how can he concludes that $\rm\,f\,$ must then be constant? Limits aren't covered in that part, so you can't let $\rm\,n\to\infty\,$ 
Is this just a bad exercise to put in that section because i would never come up with that solution?
thanks!
$$\bbox[8pt,border:3px white solid]{\color{black}{\large}}$$

The intuition is that the sum is telescoping: Write out the first few terms:
$$f(x+[y-x]/n) - f(x) + f(x+2[y-x]/n) - f(x+[y-x]/n)+f(x+3[y-x]/n-f(x+2[y-x]/n)+\cdots +f(y)-f(x+(n-1)[y-x]),$$
and notice how all terms cancel except $f(x)$ and $f(y)$. 
Equivalently, if you divide the assumption to get: $|f(x)-f(y)| / |x-y| \leq |x-y|$, fix $y$ and take the limit $x\rightarrow y$, you'll conclude $f'(y)=0$ everywhere, a constant function.
