Is it really true that "if a function is discontinuous, automatically, it's not differentiable"? I while back, my calculus teacher said something that I find very bothersome. I didn't have time to clarify, but he said:

If a function is discontinuous, automatically, it's not differentiable.

I find this bothersome because I can think of many discontinuous piecewise functions like this:
$$f(x) =
\begin{cases}
x^2, & \text{$x≤3$} \\
x^2+3, & \text{$x>3$}
\end{cases}$$
Where $f'(x)$ would have two parts of the same function, and give:
$$\begin{align}
f'(x) = &&
\begin{cases}
2x, & \text{$x≤3$} \\
2x, & \text{$x>3$}
\end{cases} \\
= && 2x
\end{align}$$
So I'm wondering, what exactly is wrong with this? Is there something I'm missing about what it means to be "continuous"? Or maybe, are there special rules for how to deal with the derivatives of piecewise functions, that I don't know about.

Flagrantly ignoring your specific example: suppose a function $f$ is differentiable at a point $x$. Then by definition of differentiability:
$$\lim_{h\rightarrow0}\frac{f(x+h) - f(x)}{h}$$
must exist (and by this notation I mean the limits exist in both the positive and negative directions and are equal). Since the bottom of that fraction approaches $0$, it's necessary for the top also to approach $0$, or else the fraction diverges. But the top approaching $0$ is just the definition of $f$ being continuous at $x$. So a function that isn't continuous can't be differentiable.
So, your example fails to be differentiable for the same reason that it fails to be continuous, which is that top of that fraction tends to $3$, not $0$, when approached from the positive direction.
