Give an example to show that not all smooth rapidly decreasing functions are Schwartz functions.
hint is provided: Try to come up with a function
$$f(x)=\sum_k\frac 1 {2^k} f_k(x) \text{ where each of } f_k\in C_c^\infty(\mathbb{R})$$
i am wondering what kind of $f_k$ can i take here? any suggestion
You could let each $f_k$ be a "bump" function: a nonnegative smooth function that vanishes off a ball.
One way to go about this is to start with a function $g$ that satisfies the following:
There are specific examples of such functions, but we can take the existence of such a $g$ for granted.
Now let $f_k(x) = f(2^k(x-k))$. You should be able to verify that $f$ defined as in the question is rapidly decreasing. The graph of $f$ consists of a bunch of nonoverlapping bumps whose heights decrease to $0$. On the other hand, $f'(x) \not\to 0$ as $x \to \infty$ because of the cancellation of the $2^k$'s.