# Using definition of derivative at an inequality

The question is really simple but I'm not sure how can I prove it.

Let $$f : \mathbb{R} \rightarrow \mathbb{R} \phantom{2}$$ a function that verifies :

$$\exists\, K \in \mathbb{R^+}, \phantom{1}\forall\, x,y \in \mathbb{R}: \lvert f(y)-f(x) \rvert \le K\lvert \cos y - \cos x \rvert$$

Then f is differentiable at $$0$$

I proved that f is a Lipschitz function since by mean value theorem $$\forall x,y \in \mathbb{R} \phantom{3}:\frac{|\cos y - \cos x|}{|y-x|}\le 1 \implies |\cos y - \cos x|\le|x-y|$$

Then $$\exists K \in \mathbb{R^+} \forall x,y \in \mathbb{R}: |f(y)-f(x)| \le K|\cos y - \cos x|\le K|x-y|$$

So for $$x = 0$$ we have that $$|f(0)-f(x)| \le K|0-x|$$

But I'm stilled confused on how can I apply this inequality on
$$\lim_{x\to c} \frac{f(x) - f(c)}{x-c}$$

And if it's differentiable what's the value of $$f′(0)$$?

Observe that $$\lvert f(y)-f(x) \rvert \le K\lvert \cos y - \cos x \rvert;\forall\, x,y \in \mathbb{R},\\ \\ \implies \frac{| f(y)-f(x)|}{|y-x|}\le K\frac{\lvert \cos y - \cos x \rvert}{|y-x|}, \forall x\ne y$$ $$\therefore \lim_{x\to 0} \frac{| f(0)-f(x)|}{|0-x|}\le K\cdot\lim_{x\to 0}\frac{\lvert \cos 0 - \cos x \rvert}{|0-x|}=K\cdot |\sin 0|=0$$. This because $$\cos$$ is differentiable.
So you have $$\lim_{x\to 0} \frac{| f(0)-f(x)|}{|0-x|}=0$$.
You know that $$\lim_{x\to c}g(x)=0 \Leftrightarrow \lim_{x\to c}|g(x)|=0$$ and hence $$f'(0)=\lim_{x\to 0}\frac{f(x)-f(0)}{x}=0$$.
Setting $$x=0$$ we get for all $$y \ne 0$$ $$\left| \frac{f(y)-f(0)}{y-0}\right| \le K \left| \frac{\cos(y)-1}{y}\right| \, .$$ Now show that the limit of the right-hand side for $$y \to 0$$ is zero (e.g. with L'Hospital's rule, or using the definition of the derivative of the cosine).
It follows that the left-hand side also tends to zero for $$y \to 0$$, i.e. $$f'(0) = 0$$.