Antiderivative of $C_c^{\infty}(\mathbb R)$ function f is $C_c^{\infty}(\mathbb R)$ if and only if $\int_{\mathbb R} f=0$
Let $f\in C_c^{\infty}(\mathbb R)$. We have to show that there exist $g\in C_c^{\infty}(\mathbb R)$ such that $g'=f$ if and only if $\int_{\mathbb R} f=0$
I can show one side.
Suppose there exist $g\in C_c^{\infty}(\mathbb R)$ such that $g'=f$
As g is compactly supported there exist N such that g(x)=0 $\forall |x|>N$
$\int_{-M}^M f=g(M)-g(-M)=0$ So as $M\to \infty \implies $ $\int_{\mathbb R} f=0$
Conversely if $\int_{\mathbb R} f=0$ and $f\in C_c^{\infty}(\mathbb R)$ then there exists f which is infinite differentiable We have to only show that it is compactly supported.
I do not know how to show this.
Any Help will be appreciated
Let $g(x)=\int_{-\infty}^{x} f(t)dt$. Then $f$ is certainly infinitely differentiable. Suppose $f$ vanishes outside the interval $[-N,N]$. Then $g(x)=\int_{-N}^{x} f(t)dt$ and this is $0$ for $x <-N$ and constant for $x >N$ {Why?). But the constant value for $x>N$ is $\int_{-\infty}^{\infty} f(t)dt$ which is given to be $0$. Hence $g$ also has support in $[-N,N]$.