Infinitely differentiable How can one find if a function $f$ is infinitely differentiable?

If a function is infinitely differentiable, then one of 3 things holds true, concerning the sequence $S$, that consists of 1. $f$, 2. the derivative of $f$, 3. the derivative of the derivative of $f$, and so on. (If f is infinitely differentiable, S is infinite, and vice versa.)


*

*There is no repetition. 

*The sequence repeats - one of its elements is a function G, that is its own derivative. (I might call this convergence.) Thus, S ends up just being G over and over again forever.

*The sequence repeats - it contains a sequence of consecutive elements C, such that the derivative of the last element of C is the first element of C. Thus, S ends up just being C over and over again forever. (3. is a generalization of 2.)


$2.$ or $3.$ are somewhat useful properties - if we prove the sequence $S$ has them, $S$ is infinite, and $f$ is infinitely differentiable.
2.
Let $f$ be $x$. Then $S$ is $x$, $1$, $0$, $0$, $...$
Since the derivative of $0$ is $0$, $S$ is infinite, and $f$ is infinitely differentiable.
3.
Let $f$ be $sin(x)$. Then $S$ is $sin(x), cos(x), -sin(x), -cos(x), sin(x), cos(x)$$, -sin(x), -cos(x), ...$ 
Since the derivative of -cos(x) is sin(x), S is just the same 4 functions over and over again, forever. Since $S$ is infinite $f$ is infinitely differentiable.
