Meaning of the nth order derivative

We say that the number zero is infinitely differentiable(because every higher order derivative exists and is identically zero). But then if that is the case , shouldn’t every function be infinitely differentiable ? Suppose we differentiate a differentiable function $n$ number of times and we get zero , we can still differentiate it infinitely right ? Then why do many textbooks call a function twice differentiable , thrice differentiable etc. ? I’m sorry if this sounds really stupid but this was something me and my friends had a huge debate on so I wanted to clear it once and for all ! Please correct me if I am mistaken somewhere Thanks for your help

• When we differentiate $0$, we actually mean function $x \mapsto 0$, not the number $0$ Jul 20, 2018 at 18:22
• Numbers aren't differentiable, functions are. Sometimes some $n$th derivative of a function will happen to have a zero value. That tells you something about the function. Sometimes a function can be differentiated twice but not three times. Jul 20, 2018 at 18:22
• Polynomials are infinitely differentiable. But the function $f(x)=x|x|$ is differentiable once, but not twice. Jul 20, 2018 at 18:23
• @Aditi $e^x$ is infinitely differentiable and its derivative is never $0$. Jul 20, 2018 at 18:27
• @Aditi: There are lots of functions other than polynomials which are infinitely differentiable. For example:$\;\sin(x)$,$\;e^x$,$\;\frac{1}{x^2+1}$. Jul 20, 2018 at 18:30

First, if you differentiate a function $n$ times and get zero, then yes the function in question is infinitely differentiable because the zero function is itself infinitely differentiable. Of course in this case the function was necessarily a polynomial of degree at most $n-1$, so you sort of already knew they were infinitely differentiable.
Examples of functions which are finitely many times differentiable are $x|x|^n$, which is $n$ times differentiable at $0$ for positive integers $n$.
I'm guessing that by saying that the number $0$ is differentiable you mean that the funcion $f(x)=0$ is infinitely differentiable, which is true because of your argument. Anyways, if you assume that the $n$-th derivative of a funcion is 0, you can integrate $n$ times and conclude that the funcion is a polynomial, which most funcions aren't. If you want a concrete example or a funcion which is $n$ tines differentiable, integrate $f(x)=|x|$ that amount of time. The result is a function which is $n$ times differentiable over $\mathbb{R}$, but it isn't at the origin.