It can be proven that
$X \equiv \{f \in {\cal C}^\infty_0(\mathbb R) \ | \ \exists \ g \in {\cal C}^\infty_0(\mathbb R)$ that verifies $ g' = f \}$ is isomorphic to $Y \equiv \{ f \in {\cal C}^\infty_0 (\mathbb R)\ | \ \int_\mathbb R f \ dx = 0\}$
so, in other words
Every derivative of a compactly supported function is compactly supported if and only if it's odd.
Question. Is there an example of a compactly supported function whose derivative is not compactly supported?