Counter-example for Lipschitz function Is the following statement true or false?

Let $f : [0,1] \to \mathbb{R}$ be a continuous function such that

*

*$|f(x)-f(0)|\leq |x|$ for all $x\in[0,1/2]$

*For all $\varepsilon >0$ there exists $C_{\varepsilon}>0$ such that $|f(x)-f(y)|\leq C_{\varepsilon}|x-y|$ for all $x, y \in [\varepsilon , 1]$.

Then $f$ is Lipschitz on $[0,1]$.

I think that the statement is false but I'm not able to produce a counter-example.
Here is some intuition: Since $C_{\varepsilon}$ may go to infinity as $\varepsilon \to 0$, then it is not useful when proving that $f$ is Lipschitz in a neighborhood of $0$. And the condition $|f(x)-f(0)|\leq |x|$ alone is not powerful enough: take $x=1/n$ and $y=1/n+1/n^2$, we have $|x-y|=\frac{1}{n^2}$ but $|f(x)-f(y)|\leq |f(x)-f(0)|+|f(y)-f(0)|\lesssim \frac{1}{n}$ which is too big.
 A: The function $f(x) = x \cdot \sin \frac{1}{x} \; (x > 0)$, $f(0) = 0$ is a
counterexample.
A: What you (and every real analysis student) need is a repertoire of counterexamples.  You can see that Hans could find one easily since he likely carries that function $f(x)=x \sin \frac1x$ around in his backpack.
The sine qua non of real analysis counterexamples is the Cantor function.  Don't leave home without it.  But this family of functions is indispensible too:
$$ f_{pq}(x) = x^p \sin x^q .$$
In fact there is a nice Monthly article loudly singing its "praise."

Kaptanoğlu, H. Turgay, In praise of $y=x^α \sin(\frac1x)$. Amer.
Math. Monthly 108 (2001), no. 2, 144–150.

Here is the Math Review of the article [lightly edited]:
The article celebrates the versatility of the family of functions in the title in providing counterexamples to statements that the beginning student of calculus or real analysis might naively or incautiously assume to be true. The following examples and counterexamples are detailed:

*

*An honest-to-goodness example for the squeeze theorem for limits.


*A continuous function that is not differentiable.


*A function for which the easy proof of the chain rule fails.


*Limit of a product of two functions versus the product of their limits.


*A function that is differentiable with a discontinuous derivative.


*A function with no local extremum at an endpoint.


*A function for which a critical point is neither an extremum point nor an inflection point.


*A differentiable function of two variables with a discontinuous derivative.


*A function of two variables to which the mean value theorem does not apply.


*A uniformly continuous function with an unbounded derivative.


*A function that is not differentiable but satisfies a one-point Lipschitz condition.


*A continuous function that is not of bounded variation.


*A function whose graph is not a rectifiable curve.


*An absolutely continuous function that is not Lipschitz.


*A differentiable function with an extremum value at an interior point at which its derivative does not have a simple change of sign.


*A nonincreasing function with a positive derivative.


*A differentiable function to which the inverse function theorem does not apply.


*A function for which the fundamental theorem of calculus fails.


*A connected set that is not path connected.
[Reviewed by G. A. Heuer.]
To this list I would add one of my favorites.  Many real analysis students are so impressed with the Lebesgue integral that they cannot conceive of such a simple  example:
20.  There is an everywhere differentiable function $F$ that is not of bounded variation on $[0,1]$;  moreover $F'$ is continuous on $(0,1]$.  The function $F'$ is (therefore) not Lebesgue integrable even though the improper Riemann integral obviously does exist and $\int_0^1 F'(x)\,dx = F(1)-F(0)$.
P.S.  The example in #20  also answers the question posed here and offers as well an everywhere differentiable function satisfying these conditions and yet not Lipschitz (since it is not even of bounded variation).
