$Edit$: I use the term "smooth" here to mean "infinitely differentiable".
I would like to ask for some advice on figuring out whether a function is smooth or not, especially when the function is a product, quotient or a composition of other functions. The two example functions which I encountered and which made me ask this are:
$f(x) = \begin{cases}\sin (x)\exp (-\frac{1}{x^2}) & x\neq 0 \cr 0 & x = 0\end{cases}$
and
$g(x) = \begin{cases}\ln (x)\sin (2\pi x) & 0 < x \leq 1 \cr 0 & x = 0\end{cases}$
For the second one it's pretty easy to see it's not differentiable at $0$ just by applying the definition of a derivative, yet if it wasn't defined like that at point zero, I would be lost, as I am with the first one. So yeah, any advice on how to find whether these kinds of functions are smooth or not would be greatly appreciated.
You can do the first one with this theorem which is a simple consequence of the mean value theorem.
Let $f$ be defined on $(a,b)$ and differentiable except perhaps at the point $c\in(a,b).$ Suppose further that $\lim_{x\to c}f'(x)$ exists. Then $f$ is differentiable at $c$ and $f'(c)= \lim_{x\to c}f'(x)$.
Of course the given $f$ is smooth for $x\neq0$ and when we differentiate it repeatedly, we will obviously get expressions of the form $$f^{(n)}(x)=\exp(-1/x^2)\left(\sin(x)P_n(1/x)+\cos(x)Q_n(1/x)\right)$$ for some rational functions $P_n$ and $Q_n$.
As $x\to0$, $\exp(-1/x^2)->0$ much faster than $P_n(1/x)$ and $Q_n(1/x)$ go to $\pm\infty$ so $$f(n)(0)=0,\ n=0,1,2,\dots$$