It is possible to construct such function?

It is possible to construct a $C^1$ function $f:\mathbb{R}\rightarrow\mathbb{R}$, such that $f(0)=0$; in every interval containing the origin, $f$ has infinite zeroes and $\operatorname{deg}(I,f,0)\neq 0$ for every open bounded interval $I$ containing the origin where the degree is defined?

Note: $\operatorname{deg}(I,f,0)\neq 0$ denotes the topological degree of $f$ with respect to the bounded open interval I and $0$.

Update: Sorry about the confusion. As Willie pointed out in the comments, if we want to calculate the dergree of an functions within regular values in an open bounded set $\Omega$, then we just sum the signal of the derivatives of $f'(x)$, where $f(x)=0$. We observe that for degree to be defined, it is necessary that $0\notin f(\partial\Omega)$. When the value is not regular, by Sard's theorem, for any ball $B_\delta(0)$ there exists regular values in $B_\delta(0)$. Choose $\delta$ in such an way that $B_\delta(0)\cap f(\partial\Omega)=\emptyset$. Then the degree of $f$ with respect to $0$ in $\Omega$ is the degree of $f$ with respect to any regular value in $B_\delta(0)$ in $\Omega$.

• What does degree mean here? – Chris Eagle Mar 13 '13 at 23:26
• @ChrisEagle, it is the topological degree. – Tomás Mar 13 '13 at 23:27
• Can the downvoter please explain what is the problem with the question? – Tomás Mar 13 '13 at 23:29
• To add to marty cohen's answer: if for every $I \ni 0$ we have that $f^{-1}(0)\cap I$ has infinitely many points, we immediately can conclude that $f'(0) = 0$ under the assumption that $f(0) =0$ and $f$ is continuously differentiable. This immediately tells you that 0 is not a regular value of $f$ on any interval containing the origin. – Willie Wong Mar 14 '13 at 8:56

I'm not sure what topological degree actually means, but how about $x^a sin(1/x)$ with $a$ large enough to make things nice.
• Effectively topological degree in this case means something like $$\sum_{x_i \in f^{-1}(0)} \operatorname{sgn}( f'(x_i))$$ where $\operatorname{sgn}$ returns $\pm 1$ depending on the sign of the argument. – Willie Wong Mar 14 '13 at 8:45
• But that said, your answer actually answers the question: it satisfies $f(0) = 0$, it has infinitely many zeroes in any interval about the origin, and for $a$ large enough $f'(0) = 0$ so in any interval about the original $0$ is not a regular value and the degree is not well-defined, so the condition $\mathrm{deg}(I,f,0) \neq 0$ is satisfied vacuously on any interval containing the origin. – Willie Wong Mar 14 '13 at 8:53
• @WillieWong, in fact $0$ is not a regular value, but this not mean that the degree is not defined. In the case where the degree is not an regular value, we use Sard's theorem to take an regular value close to zero and then we calculate the degree of this regular value. We can prove that the degree does not depend on the regular value, if we take an suitable one. I'm gonna make an update and try to add these things. – Tomás Mar 14 '13 at 11:10