Let $A, B$ be open subsets of $\mathbb{R}^n, \mathbb{R}^m$, respectively.
Let $f:A \longrightarrow B$.
Let $C^\infty(B)=\{g:B \longrightarrow \mathbb{R}; g \ $is smooth$\}$
If for all $ h\in C^\infty(B)$, $h \circ f$ is smooth. Then is it true that $f$ is smooth? If so , how do I show it?
Here's a big hint:
If $f(x_1,\dots, x_n) = (f_1(x_1,\dots,x_n), \dots, f_m(x_1, \dots, x_n))$, then $f$ is smooth if and only if $f_i :A\to \mathbb R$ is smooth for each $1 \leq i \leq m$.
The functions $\pi_i(x_1,\dots, x_n) = x_i$ are smooth - being polynomials.