Chapter 3, question 20 part b of Spivak's Calculus 3rd edition Suppose that $f(y)-f(x)\le(y-x)^2$ for all $x$ and $y$. (Why does this imply that $\lvert f(y)-f(x)\rvert \le (y-x)^2$ ?) .Prove that $f$ is a constant function. Hint: Divide the interval from $x$ to $y$ into $n$ equal pieces.
In the answer book, Spivak tried to prove that $$\lvert f(y)-f(x) \rvert \le \frac{(y-x)^2}{n}$$. Then he concludes that "therefore $f(y)=f(x)$ for all $x$ and $y$".
So my question is: What is he trying to prove? If he is trying to prove $f(y)=f(x)\forall x,y$, why does he make a hassle by trying to prove the inequality? It is very out of place. It makes no sense at all. I understand that he is trying to prove the inequality prove the question in the parenthesis, but we need to prove that $f(x)=f(y)$ $\forall x,y$.
QUESTION 2: Can you please help me the question in the parenthesis: $\lvert f(y)-f(x)\rvert \le (y-x)^2$?. Why is it so? We cannot take square and take root simply because $f(y)-f(x)$ can be negative. Let $f(y)-f(x)=-9$ and $(y-x)^2=8$ and you will see that square them will change the inequality ($81>64$)
I thank you very much for your answer. Spivak and the people who preceded him are truly genius, if not "monster".
 A: Let's suppose, as Spivak says, that you can prove the following inequality is true for all $x,y,n$:
$$|f(y)-f(x)| \le \frac{(y-x)^2}{n}
$$
Now let's hold the values of $x$ and $y$ constant. We may assume $x \ne y$ (because if $x=y$ then $f(x)=f(y)$ and we are done). So on the right hand side the numerator $(y-x)^2$ is nonzero, and since it is a square it is positive. We may therefore divide by $(y-x)^2$ and we get:
$$\frac{|f(y)-f(x)|}{(y-x)^2} \le \frac{1}{n}
$$
On the left hand side of this inequality we have a non-negative number which is constant (because $x$ and $y$ are being held constant, the numerator is non-negative, and the denominator is positive). This number is less than every fraction $\frac{1}{n}$ for all natural numbers $n \ge 1$. This implies that the left hand side equals zero:
$$\frac{|f(y)-f(x)|}{(y-x)^2}=0
$$
Now multiply by $(y-x)^2$ and you get
$$|f(y)-f(x)|=0
$$
and so
$$f(y)-f(x)=0
$$
$$f(y)=f(x)
$$
Since this is true for all values of $x,y$, we are done.
A: $$f(x)-f(y)\le\frac{(x-y)^2}n\;\forall\;x,y\in\mathbb R\implies \frac{f(x)-f(y)}{x-y}\le\frac{x-y}n\;\forall\;x,y\in\mathbb R$$
Take the limit $y\to x$ do you see $f'(x)=0\;\forall\;x\in\mathbb R$. So $f(x)$ is a constant function.
