the relation between cohomology and homomorphism I meet a problem, how can I understand $H^1(M,\mathbb{R})\cong Hom(\pi_1(M),\mathbb{R})$? Where $M$ is a compact manifold. Thanks in advance.
 A: First note that this isomorphism does not require $M$ to be a compact manifold, only that it is connected.
The isomorphism is given by integrating one-forms along closed curves. That is, if $[\alpha] \in H^1_{\text{dR}}(M)$ define $I_{[\alpha]} \in \operatorname{Hom}(\pi_1(M), \mathbb{R})$ by 
$$I_{[\alpha]}([\gamma]) = \int_{\gamma}\alpha.$$
First, one needs to check that this map is well-defined (independent of the choices of representatives of $[\alpha]$ and $[\gamma]$). This is done in Theorem 17.7 of Lee's Introduction to Smooth Manifolds (second edition), where it is also proved that the assignment $[\alpha] \mapsto I_{[\alpha]}$ is injective. The surjectivity of this map is the goal of Problem 18-2 of the same book.
Added Later: In the comments, the OP wanted to know whether $H^n_{\text{dR}}(M) \cong \operatorname{Hom}(\pi_n(M), \mathbb{R})$ for any other values of $n$. The answer is no. 
First of all, for $n = 0$, $\pi_0(M)$ is not a group so $\operatorname{Hom}(\pi_0(M), \mathbb{R})$ is not defined. 
For $n > 1$, consider $M = (S^1)^n$, the $n$-dimensional torus. We have 
$$\pi_n(M) = \pi_n((S^1)^n) = (\pi_n(S^1))^n = 0,$$ 
so $\operatorname{Hom}(\pi_n(M), \mathbb{R}) \cong \operatorname{Hom}(0, \mathbb{R}) \cong 0$, but $H^n_{\text{dR}}(M) = \mathbb{R}$ as $M$ is a connected, compact, orientable $n$-dimensional manifold.
