Question is to show that $d(f)=0$ for a $0$ form on $\mathbb{R}^n$ then $f$ is a constant function.
See that $$0=df=\sum_i\frac{\partial f}{\partial x_i}dx_i$$ implies that $\frac{\partial f}{\partial x_i}=0$ for all $i$.
Let $a\in \mathbb{R}^n$. For this $a$ we have $$\frac{\partial f}{\partial x_1}(a)=\lim_{h\rightarrow 0}\frac{f(a_1+h,a_2,\cdots,a_n)-f(a_1,\cdots,a_n)}{h}=0$$
Seeing this as single variable function and using mean value theorem we see that $f(a_1+p,a_2,\cdots,a_n)=f(a_1,a_2,\cdots,a_n)$ for all $p\in\mathbb{R}$
For $p=-a_1$ we have $f(0,a_2,\cdots,a_n)=f(a_1,a_2,\cdots,a_n)$
Now, do the same thin for $f(0,x_2,c_3,\cdots,x_n)$ and conclude that $f(0,0,\cdots,a_n)=f(0,a_2,\cdots,a_n)$.
Combining with previous result we have $f(0,0,\cdots,a_n)=f(0,a_2,\cdots,a_n)=f(a_1,a_2,\cdots,a_n)$.
Repeating this, we get $f(0,0,\cdots,0)=f(a_1,a_2,\cdots,a_n)$. Thus, $f$ is constant.
Now, i am not sure if i can really use this type of approach and succeed in case of $1$ forms.
Suppose $f$ is a $1$ form and $df=0$ i.e., $f=g_1dx_1+g_2dx_2+\cdots g_ndx_n$ and $df=0$ implies $$0=df=\sum_i d(g_i)\wedge dx_i=\sum_{i,j}\frac{\partial g_i}{\partial x_j}dx_j\wedge dx_i$$
So, we have $$\frac{\partial g_i}{\partial x_j} - \frac{\partial g_j}{\partial x_i}=0$$for all $i,j$.. I am not sure how to use this...
Note : Credits to above correction goes to user muaddib
Please suggest some hints...