Finding example of a special type of continuous differentiable function Give example  of a continuous function (if exists) $f : [a,b]\to \mathbb R$ differentiable in $(a,b)$ such that $f(a)f(b) \ne 0$ , the set $A:=${ $x \in (a,b) : f(x)=0$ } is infinite but not an interval  . Please help 
 A: The following is maybe too fancy. Let $a=-1$ and $b=1$. Let 
$$f(x)= \begin{cases} x^2\sin(1/x) & \text{if } x \ne 0, \\ 0 & \text{if } x=0. \end{cases}$$ The derivative of this function exists at $0$, but is not continuous there. If you want greater smoothness at $0$, replace $x^2$ by $x^{77}$
If you want the same sort of thing on a general interval $(a,b)$, map $-1$ to $a$ and $1$ to $b$ via a linear mapping. So instead of $x$ use $\frac{2x-a-b}{b-a}$. 
A: Here is an example of a function of class $C^{\infty}$, based on the one of André Nicolas: 
$$
f(x) = 
\begin{cases}
e^{-1/x^2} \cdot \sin(1/x) & \text{if } x\ne 0,\\
0 & \text{if } x = 0.
\end{cases} 
$$
The zeroes are again the numbers $0$ and $ 1/k \pi$ where $k$ in $\mathbb{Z}\backslash\{0\}$.
Let us also recall  the following theorem due to Hassler Whitney: for every open subset $U$ of a numeric space $\mathbb{R}^m$ (works for smooth manifolds with countable basis too) and $A$ closed subset of $U$ there exists a $C^{\infty}$ function on $U$ with the zero level set the subset $A$.
Also, there exists no such analytic function hence no function given by one elementary formula.
