TITLE: Understanding de Rham cohomology: geometrically speaking, when is a smooth function closed
QUESTION [6 upvotes]: On Wikipedia the de Rham cohomology groups are defined to be the cohomology groups of the de Rham cochain complex (equivalence classes of differential $k$-forms). 
By this definition the zeroth de Rham cohomology group is the set of all closed differential zero forms modulo all exact $0$-forms (i.e. modulo the image of the exterior derivative). In formula,
$$ H^0_{dR} = {\ker d^{1}\over \mathrm{im } d^0 } = \ker d^{1}$$
Since $d^0: 0 \to \Omega^0$ is the trivial map.

Question1: Am I correct so far?

Using the notation and terminology on Wikipedia $H_0$ is therefore the set of all closed $0$-forms. Since $0$-forms are smooth functions the question arises what it means for a smooth function $f$ to be closed, that is, which $f$ have vanishing exterior derivative $df=0$. 

Question2: How to determine whether a smooth function is closed?

REPLY [6 votes]: Think about this in the case of $\mathbb{R}^1$.  What kind of functions have $\frac{df}{dx} = 0$ everywhere?
After this, what happens in $\mathbb{R}^n$ when all of the partial derivatives vanish?
Now a slightly harder case:  In $\mathbb{R}^1-\{0\}$, what kind of functions can have vanishing derivative?  Are there more or less such functions than for all of $\mathbb{R}^1$?
Maybe now you are starting to guess that the dimension of $H^0$ counts something.  What does it count?