Prove that $f$ is uniformly continuous I have to prove this:

Suppose $f:(a,b)\to \mathbb{R}$ is differentiable and $|f'(x)| \leq M$ for all $x\in (a,b)$. Prove that $f$ is uniformly continuous on $(a,b)$.Give an example of a function $f:(0,1) \to \mathbb{R} $ that is differentiable and uniformly continuous on $(0,1)$, but such that $f'$ is unbounded.

My attempt:
Since $f$ is differentiable we know that for all $\epsilon>0$ there exists a $\delta>0$ such that if $|x-y|<\delta$ then:
$$\left|\frac{f(x)-f(y)}{x-y}-f'(x)\right|< \epsilon$$
then we choose $\delta=\frac{\epsilon}{\epsilon+M}$ and we have that:
\begin{multline}
\left|\frac{f(x)-f(y)}{x-y}-\right| \epsilon+f'(x) \leq \epsilon +M \\
\Rightarrow |f(x)-f(y)|<(\epsilon +M)|x-y|<(\epsilon +M) \delta= \epsilon
\end{multline}
Therefore $f$ is uniformly continuous.
Now let's consider the function $f: \mathbb{R_{\geq 0}} \to \mathbb{R}$ such that $f(x)= \sqrt{x}$. To see that $f$ is uniformly continuous we note that it is continuous at all its dominion, therefore $f$ is continuous at $[0,1]$ then we have that $f$ is uniformly continuous at $[0,1]$, this means that the same $\delta$ Works for $x,y \in (0,1)$, and therefore $f$ is uniformly continuous at $(0,1)$ , but $f'(x)=1/2 \sqrt{x}$ that is clearly unbounded.
Can you tell me if I am right please, if not how can I fix the problems please, thank you a lot.
 A: Example is $f(x)=x^{\frac{1}{n}}$, basically you have to construct a function whose limit exists at end points and  derivative is unbounded in $(0,1)$
A: You write ‘Since $ f $ is differentiable we know that for all $ \epsilon > 0 $ there exists a $ \delta > 0 $’, but you don't know that unless $ f $ is uniformly differentiable (which is a stronger condition that doesn't follow from what you're given).  Then in the next line you say that $ \delta $ is $ \epsilon / ( \epsilon + M ) $, but even if $ f $ were uniformly continuous, you have no way of knowing that $ \delta $ can be that large.
Now, you are right to try to say that, given $ \epsilon $, you should find $ \delta $, because you're trying to prove that $ f $ is uniformly continuous, and that's how that goes.  So you do want to prove that $ \lvert f ( x ) - f ( y ) \rvert < \epsilon $ whenever $ \lvert x - y \rvert < \delta $, but you can't assume that $ \big \lvert \big ( f ( x ) - f ( y ) \big ) / ( x - y ) - f ' ( x ) \big \rvert < \epsilon $ along the way.  So I won't use that.
Whatever intuition led you to $ \delta = \epsilon / ( \epsilon + M ) $ is sound.  You can basically draw a picture of the situation to guess that $ \delta = \epsilon / M $, but since it doesn't do to cut things too close, you should make $ \delta $ slightly smaller than this (while keeping it positive), and $ \epsilon / ( \epsilon + M ) $ does the trick.  As it happens, in this case, you can simply take $ \delta $ to be $ \epsilon / M $, so that is what I'll do here, but it doesn't hurt to give yourself some breathing room.
Now I think that you should use the Mean Value Inequality (MVI).  This says that any constant bounds satisfied by a derivative must also be satisfied by the difference quotients.  In this case, since $ \lvert f ' \rvert \leq M $, you know that $ \big \lvert \big ( f ( x ) - f ( y ) \big ) / ( x - y ) \big \rvert \leq M $.  (You can think of this as following from the Mean Value Theorem; if this bound were ever violated, then it would be violated by the derivative where it equals the difference quotient, which the MVT says must happen somewhere between $ x $ and $ y $.  But in my opinion, the MVI is actually the more fundamental result, and the MVT should be seen as a corollary of the MVI rather than the reverse.)
Then if $ \lvert x - y \rvert < \delta $, you immediately get $ \big \lvert f ( x ) - f ( y ) \big \rvert \leq M \lvert x - y \rvert < M \delta = M ( \epsilon / M ) = \epsilon $.
If you'd rather use the MVT than the MVI, then you can run this backwards as a proof by contradiction.  Again, the claim is that $ \delta = \epsilon / M $ shows that $ f $ is uniformly continuous, but let's suppose (by way of contradiction) that there exist $ x $ and $ y $ such that $ \lvert x - y \rvert < \delta $ but $ \lvert f ( x ) - f ( y ) \rvert \geq \epsilon $.  Then $ \big \lvert \big ( f ( x ) - f ( y ) \big ) / ( x - y ) \big \rvert > \epsilon / \delta = M $, which by the MVT means that $ \lvert f ' ( z ) \rvert > M $ for some $ z $ between $ x $ and $ y $, but we're given that this is false.
