What does it mean to not be able to take the derivative of a function multiple times? 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.   
 A: Some functions have a derivative that cannot be further differentiated.
For example, consider the function $f(x) = |x|$. It is not differentiable but it can be integrated. Any antiderivative $F(x)$ of $f(x)$ will be differentiable and we have $F'(x) = f(x)$. Since $f$ is continuous, $F \in C^1$ but since $f$ is not differentiable, $F \notin C^2$.
A: 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.)
A: As an example:


*

*$f(x)=6|x|$ does not have a derivative at $x=0$

*$g(x)=3x|x|$ does have a first derivative everywhere of $f(x)$ but not a second derivative at $x=0$

*$h(x)=x^2|x|= |x^3|$ has a first derivative everywhere of $g(x)$ and a second derivative of $f(x)$ but not a third derivative at $x=0$
A: I'll address your points one by one. If you have further questions, please ask away:
Aren't all functions $C^\infty$ then?
No. Examples of functions whose $k$-th order derivative is not continuous abound for every $k$. It is true that $C^1$ functions are very similar to $C^\infty$ functions, but for the time being it is better to focus on the ones we will encounter.
There are even functions that are continuous but not derivable at any point. One of them is the Weierstrass function, and I'm pretty sure you'll encounter it further down the road in this course. If you find this read difficult to follow, don't worry, I'm sure your lecturer will give you great explanations (and you are of course welcome to ask).
Can't you just keep taking the derivative of a function even if it becomes $0$?
$0$ is just another value a derivative can take. There are some functions that lack a derivative. Some do have a derivative. Of these, some are zero; some are not.
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?
Not exactly. It means that the second derivative is continuous, but it says nothing about the third one, because it doesn't really matter. $C^3$ functions are also $C^2$: note that if you can do something like taking derivatives three times you can also do it twice, but being able to do it twice is no guarantee you can go on and do it a third time.
