Analysis-Baby Rudin's differentiability and continuity: theorem 5.2 and 5.6 I am very confused about differentiability and continuity. At the beginning of the differentiation chapter, we proved that differentiability contains continuity. (Theorem 5.2)
But in example 5.6 and the next section of the chapter implies that there is a function that is differentiable at some points or interval but the function is not continuous. 
I guess I am missing something or misunderstanding definition of continuity and differentiability. Please help how I can understand the basic definition and ideas of continuity and differentiability. 
Thanks in advance 
 A: We say that a function $f\colon (a,b)\to \mathbb{R}$ is continuous at a point $c\in (a,b)$ if $\lim_{x\to c}f(x)$ exists and is equal to $f(c)$ (there exists of course other equivalent definitions for continuity). The main point is that continuity is defined only at a point. The phrase "$f$ is continuous in a interval $(a,b)$" just means that $f$ is continuous at every point $c\in (a,b)$.
Differentiability is again defined pointwise, and we say that a function $f$ is differentiable at $c\in (a,b)$ if
$$
\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}
$$ exists and in that case the limit is the derivative of $f$ at a point $c$.
Again when we say that a function is differentiable in an interval $(a,b)$ we mean
that the above limit exists for every $c\in (a,b)$. It is a well known fact that differentiability at a point $c$ implies continuity in $c$, but differentiability at $c$ does not imply differentiability nor continuity at any other point apart from $c$. Nor can you conclude that $f'$ would be continuous.
A common example of a differentiable function, for which the derivative is not continuous at origin is
$$
f(x)=\cases{ x^2\sin(1/x),\ &$x\neq 0$\\
0,\ &$x=0$}.
$$
