I'm trying to work out what $H^0_{dR}(\mathbb{R}^2 \setminus \{p,q\})$ is, and I've come across the fact that the dimension of $H^0_{dR}(M)$ is equal to the number of connected components of the manifold $M$. Is this true in general?
Is there a simple way to work out the number of connected components of, say, $\mathbb{R}^2 \setminus \{p_1, \ldots, p_n\}$? If so, how does one go about it?
Yes, this fact is true in general and can be worked out by hand without referring to other cohomology theories: The key observation is that any closed function is necessarily locally constant, which you can show by passing to local coordinates. Using this, one can easily form a basis for the zero'th homology.