TITLE: What does it mean to not be able to take the derivative of a function multiple times?
QUESTION [7 upvotes]: I'm taking a intro to mathematical analysis course and I'm having trouble understanding this definition. 
They are talking about how it can be interesting to see what happens if you take the derivative of a function multiple times (this is discussed in the intro to Taylor polynomials). They throw this definition at us, which they call $C^kfunctions$:
A function $f: I \rightarrow \mathbb{R} $ belongs to $C^k(I)$ if it is possible to take the derivative of the function k times on $I$ and if $f^{(k)}(x)$ is continuous on $I$
I'm a little confused by this. Aren't all functions $C^\infty$ then? Can't you just keep taking the derivative of a function even if it becomes $0$? Specifically I'm on a chapter now where they are discussing curve integrals and they keep mentioning that it is a $C^2$ function. What does this mean? Can you only take the derivative 2 times?
I'm confused and can't wrap my mind around it. I would love if anyone was able to explain it in such a way that I could understand and apply it. Thanks in advance.

REPLY [7 votes]: I think a picture can help explain what's going on here. Below is a graph of a function (red) and its derivative (blue). The original function is differentiable, which we can see by its lack of "sudden turns". However, the derivative is not, as evidenced by the "pointy turn" at $(0,0)$.
\begin{align}
\text{(red)} \qquad f(x) &= x \cdot |x| \qquad\qquad \qquad \\
\text{(blue)} \quad\,\,\, f'(x) &= 2 \cdot |x| \qquad\qquad \qquad
\end{align}

Part of the reason why this idea can be confusing is that the original (red) function looks smooth, but it's not smooth by the math definition since its first derivative isn't differentiable. While $f(x)$ has no pointy bits, it has the spirit of one inside, just waiting to be released.
(By the way, if you're wondering how we derive $f'(x)$ you can see that here.)