n-th derivative condition to become polynomial for real function

I've seen a similar result in complex analysis, when an entire complex function satisfies $f(z)f^{(n)}(z)=0$ for all $z \in \mathbb{C}$ implies that $f(z)$ is polynomial.

What if when $f: \mathbb{R} \rightarrow \mathbb{R}$ is a $n$ times differentiable function such that $f(x)f^{(n)}(x)=0$ for all $x\in\mathbb{R}$, does it follow that $f$ is polynomial?

thanks.

what i have tried so far: I tried induction: for $n=1$ we have $f(x)f'(x)=0$ which means $f(x)^2=c$ hence $f'(x)=0$ for all $x$. Supposing the statement is true for $n−1$, I want to prove that $f^{(n)}(x)f(x)=0$ will implies $f^{(n)}(x)f'(x)=0$ which implies $f^{(n)}(x)=0$ (by induction hypothesis) .. my idea is to define function $g$ such that i could get $f^{(n)}(x)f'(x)=0$.. i'm stuck here.. I have another try, by analysing $\bigcup A_j$, where $A_j$ is the open interval on which $f(x)$ is not zero (it can be proved it is indeed interval). I also have tried taylor theorem.

-
@Ajat: Presumably you are assuming that $f(x) f^{(n)}(x) = 0$ for all positive integers $n$? The way it is worded now, it sounds like you are assuming it only for a specific $n$. – JavaMan Jun 11 '11 at 3:54
@Ajat. On second thought, maybe the question you are asking is this: Suppose that $f(x)$ is a function such that for some $n$, we have $f(x)f^{(n)}(x) = 0$. Show that $f(x)$ is a polynomial. Is this right? – JavaMan Jun 11 '11 at 4:00
The theorem holds under the stronger assumption that $f$ is $C^n.$ To see this, note that in this case, the set of $x\in\mathbb{R}$ such that $f^{(n)}(x) \neq 0$ is open. Hence, if $f^{(n)}$ does not vanish at some point $x$ it must not vanish on some open neighborhood $W$ of $x$. But as $ff^{(n)} = 0,$ it follows $f$ is equal to the zero function on $W.$ Consequently, $f^{(n)}$ is defined at $x$ and equal to $0,$ a contradiction. We conclude that no such point $x$ exists and $f^{(n)}=0.$ – jspecter Jun 11 '11 at 4:13
i assume that the statement: "P(k): if $f$ is real function satisfies $f(x)f^{(k)}(x)=0$ then $f^{(k)}(x)=0$." is hold up to $k=n-1$. I proved for $P(1)$. The function is flexible then, if we use $f'(x)$ for $P(n-1)$ then we get $f'(x)f^{n}(x)=0$ implies $f^{n}(x)=0$. @DJC: yes, it for a given fixed $n$ . – Ajat Adriansyah Jun 11 '11 at 4:16
@Ajat: It would be nice if you delete your comment and add what you have tried in the question itself. – user9413 Jun 11 '11 at 4:28

Since $f$ is continuous the set $S:=\{x\in{\mathbb R}\ |\ f(x)\ne 0\}$ is open, so it is a countable union of open intervals. Let $I:=\ ]0,h[\$ be such an interval. As $f^{(n)}(x)\equiv 0$ on $I\$ there is a polynomial $p$ of degree $\leq n-1$ such that $f(x)=p(x)$ on $I$. Assume $p$ is given by $p(x)=\sum_{k=r}^{n-1} a_k x^k$ with $a_r\ne 0$.
Now $f$ has a Taylor expansion of order $r$ at the origin, which means that there is a polynomial $j(x)=\sum_{k=1}^r c_k x^k$ such that $f(x)=j(x) + o(x^r)$ $\ (x\to 0)$. Since for all $x\in I$ we have $f(x)=p(x)$ it follows that $j(x)=a_r x^r$, and this implies $$f(x)=(a_r + o(1)) x^r \qquad (x\to 0).$$ It follows that the zero $0$ of $f$ is in fact isolated, whence it is the right endpoint of an interval $I':=\ ]-h,0[\$ of $S$. Using the Taylor expansion of order $n-1$ at $0$ we can verify that $f(x)=p(x)$ on $I'$ as well.
This argument carries through for all component intervals of $S$; therefore $f$ has only isolated zeros on ${\mathbb R}$. Any finite interval $\ ]-M,M[\$ can only contain a finite number of such zeros, and in between we have a single polynomial $p$ that represents $f$. It follows that in fact $f(x)=p(x)$ on all of ${\mathbb R}$.