Why differentiate between continuous on $[a,b]$ and differentiable on $(a,b)$? Before starting I want to say that my main language is not english so you may find some grammar mistakes. I will try to avoid making them as much as I can, so please forgive me.
A few months ago I decided that I wanted to learn Calculus so I got some books and started to study, during that time I faced a statement that is pretty common among math definitions related to it, and that statement is:

$f(x)$ is continuous at $[a,b]$ and differentiable at $(a,b)$

What I was thinking was that a limit needs a closed interval to compute its value, but after making some research I found that the function $f(x) = \sqrt{x}$ is continuous at $0$, so I started to make myself this question.
If we consider, for example $f(x) = x^2$. and the interval $[1,3]$. We know that the function is differentiable and continuous at its whole domain but we do we say that it has to be continuous at $[1,3]$ and differentiable at $(1,3)$, this of course, considering the function over the interval mentioned before, when in fact it is differentiable at $1$ and $3$.
Also the function $\sqrt{x}$ is considered continuous at its whole domain, even also at $x = 0$ but it is not differentiable at 0. Why?
Why do we do this difference between $[a,b]$ and $(a,b)?$
Sorry if I did not express myself the best way possible, again, English is not my main language.
 A: Consider the following function. It's continuous on $[0,1]$, differentiable on $(0,1)$ but neither at $0$ nor $1$. Yet Rolle's theorem still applies and guarantees there is an $x$ in $(0,1)$ such that $f'(x)=0$. It's for this kind of situation that it's fundamental to distinguish between continuity on $[a,b]$ and differentiability on $(a,b)$. Had Roll's theorem been proved for $f$ differentiable on $[a,b]$, we could not draw any conclusion for this function.

A bit of nostalgia: in the equivalent of first year undergraduate studies, in 1998, our teacher asked the class to try and prove Rolle's theorem. He inadvertently assumed differentiability on $[a,b]$, and I inadvertently drew the picture above to find inspiration. Until he noticed my mistake, which led him to notice his - that differentiability at the bounds is unnecessary. It's during those years I learned the importance of the slightest details in assumptions. I hope you will see too how important this is.
A: The short answer is: we often desire for the assumptions of a theorem to be least restrictive possible, so that the theorem is most general and widely applicable. It turns out that in many theorems you require continuity on $[a, b]$, but you do not actually need differentiability at the endpoints, only on $(a, b)$.
For example, in the proof of Rolle's theorem, we have a function $f$ defined on $[a, b]$ such that $f(a)=f(b)$ and we wish to establish the existence of a point $c \in (a, b)$ such that $f'(c) = 0$. We know that $f$ must have the maximum on $[a, b]$ and we define $d$ to be an argument for which the maximum is attained. Now there are two cases. Either $d$ is an endpoint of $[a, b]$ or an interior point. In the first case $f$ is the constant function and we are done without explicitly invoking differentiability of $f$ (even though every constant function on a suitable domain is differentiable). In the second case we invoke differentiability in order to say that $f'(d)$ exists before we observe that $f'(d)=0$.
This example shows that sometimes differentiability of a function in the interior $(a, b)$ of an interval $[a, b]$ may simply be all that is needed to establish a conclusion.
There is also the subtle point that consideration of differentiability and derivative of a function defined on a closed interval at an endpoint of the interval requires that we appropriately interpret the definition as referring to one-sided limit. The subtlety disappears if we only consider differentiability and derivatives on open sets.

Regarding the reason that the function $\sqrt{x}$ is not differentiable at $x=0$ it is because the tangent to its plot becomes vertical at this point. Equivalently, the limit $$\lim_{x\to 0_+}\frac{\sqrt{x}}{x} = \lim_{x\to 0_+}\frac{1}{\sqrt{x}} $$ does not exist.
A: The classic counterexample to differentiability is $f(x) = \vert x \vert$ and its translates.
Consider e.g. $g(x) = \vert x\vert -2$. You can apply the Intermediate Value Theorem, Rolle's Theorem, Mean Value Theorem, etc. to $g$ (and indeed $f$, although that may be less interesting) on the interval from $0$ to $k$, for any positive integer $k$, despite the lack of differentiability at $(0,-2)$.
It's worth considering whether you can drop the continuity assumption at the endpoint. You cannot. Hint: Try a removable singularity, such as a step function.
A: In general, if you have a function $f:[a,b]\to\mathbb{R}$, the differentiability of $f$ at the left endpoint is defined as
$$
f'(a):=\lim_{h\color{blue}{\downarrow} 0}\frac{f(a+h)-f(a)}{h}
$$
whenever the limit exists. If the limit does not exist, then $f$ is not differentiable at $x=a$.
For your example $f(x)=\sqrt{x}$, you can check that the following limit does not exist:
$$
\lim_{h\color{blue}{\downarrow} 0}\frac{\sqrt{h}}{h}
$$
Differentiability at a point is a local property of a function. Usually, what matters most is the interior points of the domain when talking about derivatives; note that every point in $(a,b)$ is an interior point.
