In single variable calculus, a common way to denote a function that is continuous for all derivatives is to write $f(x) \in C^\infty$ i.e. $f(x) = \exp(x)$
Is there a more rigorous way to define $C^\infty$ (using set notations, so forth such that it can be generalized to higher dimensions)?
For the one-dimensional case it is actually not very difficult.
Assume $I\in \Bbb R$ is an open connected subset of real line. Then denote $C(I) = C^0(I)$ the set of all functions $\ f:I\to\Bbb R$ continuous on $I$, i.e. $$ C^0 = \left\{ \ f: I \to \Bbb R \ \Big| \ \ \forall \, x_0 \in I \quad \lim_{x \to x_0} f(x) = f\!\left(x_0\right) \right\} $$
Then denote $C^1(I)$ the set of (once) continuously differentiable functions : $$ C^1 = \left\{ \ f: I \to \Bbb R \ \Big| \ \ \forall \, x_0 \in I \quad \exists \ \ f' \!\left( x_0\right) = \lim_{\Delta x \to 0} \; \frac{f\left(x_0 + \Delta x \right) - f\left( x_0\right) }{\Delta x}, \ \text{ and } \ f' \in C^{0}(I) \right\}. $$
By induction we can define the set $C^n(I)$ of $n$-times continuously differentiable functions:
$$ C^n = \left\{ \, f: I \to \Bbb R \, \Big| \ \forall \, x_0 \in I \ \exists \ \ f^{(n)} \!\left( x_0\right) = \lim_{\Delta x \to 0} \frac{f^{(n-1)}\left(x_0 + \Delta x \right) - f^{(n-1)}\left( x_0\right) }{\Delta x}, \text{ and } f^{(n)} \in C^{0}(I) \right\}, $$ where $f^{(n)}$ is the $n$-th derivative of $f$ defined as $$ \begin{cases} \displaystyle{ f^{(n)} \!\left( x_0\right) = \lim_{\Delta x \to 0} \frac{f^{(n-1)}\left(x_0 + \Delta x \right) - f^{(n-1)}\left( x_0\right) }{\Delta x}}, & n\ge 2 \\ \displaystyle{ f^{(1)}\!\left( x_0\right) = f' \!\left( x_0\right) = \lim_{\Delta x \to 0} \; \frac{f\left(x_0 + \Delta x \right) - f\left( x_0\right) }{\Delta x}}, & n = 1. \end{cases} $$
Finally, we define $$ C^\infty(I) = \left\{ \ f: I \to \Bbb R \ \Big| \ \ f \in C^n (I) \quad \forall \, n \in \Bbb N^+ \right\}. $$