The relation between $H^i$ and $D$? Let $A$ be a finite dimensional k-algebra, where k is a fixed field. Suppose $$ X^{\bullet}:\cdots \rightarrow X_{-1} \stackrel{d_{-1}}{\longrightarrow} X_{0} \stackrel{d_0}{\longrightarrow} X_1 \stackrel{d_1}{\longrightarrow}  \cdots $$ is a complex of A-modules. $H^i$ is the cohomology functor,i.e. $H^i(X^{\bullet})=Ker d_i/Im d_{i-1}$. $D=Hom_k(-,k)$. I want to know wether $H^i(D(X^{\bullet})) \cong DH^{-i}(X^{\bullet})$ for any integer i?
I have done the following: $$ D(X^{\bullet}): \cdots \rightarrow DX_{1} \stackrel{Dd_{0}}{\longrightarrow} DX_{0} \stackrel{Dd_{-1}}{\longrightarrow} DX_{-1} \stackrel{Dd_{-2}}{\longrightarrow}  \cdots $$  Since $Dd_{-1}Dd_0=D(d_{0}d_{-1})=0$, $D(X^{\bullet})$ is still a complex. 
And I get $H^0(D(X^{\bullet}))=Ker D(d_{-1})/Im D(d_0)$ and $D(H^0(X^{\bullet}))=D(Ker d_0/Im d_{-1})$. 
How to get $H^0(D(X^{\bullet}))=D(H^0(X^{\bullet}))$?
 A: Your question basically boils down to the following: what happens to the (co)homology of a (co)chain complex of $k$-vector spaces after applying the dualization functor
$$(-)^\vee = \mathrm{Hom}_k (-, k).$$
The universal coefficient theorem in the other answer is a total overkill: the above functor is exact, and any exact functor commutes with taking (co)homology. That's it.
The whole point of the universal coefficient theorem is the study of the situation when you apply some inexact functor $\mathrm{Hom}_R (-, M)$.

Edit: since it seem to cause some confusion, let me sketch a proof of the fact that exact functors preserve (co)homology. So let $F$ be a contravariant functor (so that you don't think that contravariance causes any troubles; the only issue is the numeration of the complex with reversed arrows, but that is why you deal with the cohomology in degree $0$). Let $C^\bullet$ be a cochain complex
$$\cdots \to C^{-1} \xrightarrow{d^{-1}} C^0 \xrightarrow{d^0} C^1 \to \cdots$$
After applying $F$, we obtain a chain complex
$$\cdots \to F (C^1) \xrightarrow{F (d^0)} F (C^0) \xrightarrow{F (d^{-1})} F (C^{-1}) \to \cdots$$
The cohomology of $C^\bullet$ in degree $0$ is given by
$$H^0 (C^\bullet) = \operatorname{coker} (\operatorname{im} d^{-1} \rightarrowtail \ker d^0) = \ker (\operatorname{coker} d^{-1} \twoheadrightarrow \operatorname{im} d^0).$$

Now let us see what is $F (H^0)$. Since $F$ is exact contravariant, it converts kernels to cokernels and cokernels to kernels (and images and coimages are canonically isomorphic); you can check (by applying $F$ to the above diagram) that the canonical monomorphism $\operatorname{im} d^{-1} \rightarrowtail \ker d^0$ will corresond to the canonical epimorphism $\operatorname{coker} F (d^0) \twoheadrightarrow \operatorname{im} F (d^{-1})$ and the canonical epimorphism $\operatorname{coker} d^{-1} \twoheadrightarrow \operatorname{im} d^0$ will correspond to the canonical monomorphism $\operatorname{im} F (d^0) \rightarrowtail \operatorname{ker} F (d^{-1})$. Therefore,
$$F (H^0 (C^\bullet)) = \ker (\operatorname{coker} F (d^0) \twoheadrightarrow \operatorname{im} F (d^{-1})) = \operatorname{coker} (\operatorname{im} F (d^0) \rightarrowtail \operatorname{ker} F (d^{-1})).$$
But this is precisely $H_0 (F (C^\bullet))$.
A: No, that's far from being true when $k$ is not a field (the assumption that $k$ is a field was added later, please see the last paragraph of my answer). Instead you have the Universal Coefficient Theorem. In the Wikipedia article this is written for topological spaces, but more generally this applies to chain complexes (the topological case being the general theorem applied to the singular chains of a space).
For example you can look at Theorem 3.6.5 in Weibel's book An introduction to homological algebra. It says that if $P$ is a chain complexes of projective $k$-modules such that $d(P_n)$ is projective for all $n$, then you have a short exact sequence for all $n$ and for all $k$-modules $M$:
$$0 \to \operatorname{Ext}^1_k(H_{n-1}(P), M) \to H^n(\operatorname{Hom}_k(P,M)) \to \operatorname{Hom}_k(H_n(P), M) \to 0.$$
Moreover this exact sequence is split hence you have a (noncanonical) isomorphism:
$$H^n(\operatorname{Hom}_k(P,M)) \cong \operatorname{Hom}_k(H_n(P), M) \oplus \operatorname{Ext}^1_k(H_{n-1}(P), M).$$
Since you're working with cochain complexes, you probably need to adapt the statement wrt. the indices a bit. If you don't have projective components for your chain complexes, then things go crazy and as far as I know the best you can hope for is a universal coefficient spectral sequence.
For a simple example, consider the chain complex such that $P_0 = P_1 = \mathbb{Z}$, $P_n = 0$ for $n \neq 0,1$, and $d : P_1 \to P_0$ is given by $d(x) = 2x$. Then $H_1(P) = 0$, but you have
$$H^1(\operatorname{Hom}_\mathbb{Z}(P, \mathbb{Z})) = \mathbb{Z}/2\mathbb{Z} \neq \operatorname{Hom}_\mathbb{Z}(H_1(P), \mathbb{Z}) = 0.$$
Note that if $k$ is a field (or more generally a self-injective ring), however, then the Ext functor vanishes and so you have the relation you want. But it's a rather special case. For a direct proof without the UCT see Alejo's answer.
