In Petersen's Riemannian geometry text, he defines the Hodge operator $*: \Omega^k(M) \to \Omega^{n-k} (M)$ in the standard way.
He then proves (Lemma 26, Chap 7) that $*^2: \Omega^k(M) \to \Omega^k(M)$ is multiplication by $(-1)^{k(n-k)}.$
So far no problems.
However, he seems to argue that this lemma implies that the Hodge star gives an isomorphism $H^k(M) \to H^{n-k}(M),$ where we are considering the de Rham cohomology groups.
It is clear by the lemma that we have an isomorphism from $\Omega^k \to \Omega^{n-k}$ given by the Hodge star. But why must this descend to an isomorphism on cohomology?
I guess one would need to show that the Hodge star maps closed forms to closed forms, and exact forms to exact forms? Is this clear from the lemma, or am I to conclude that Pedersen is foreshadowing a theorem to come?
The Hodge star definitely does not map (for example) closed forms to closed forms. Here is a simple example to show this: on a Riemannian $n$-manifold, consider the $n$-form $\omega = f \, \text{vol}$, where $f$ is a smooth function and $\text{vol}$ is the Riemannian volume form. Note that since $\omega$ is an $n$-form, it is always closed. But $\star \omega = f$, which is closed if and only if $f$ is (locally) constant.
I don't see a good reason to expect $\star$ to give an isomorphism on cohomology, other than the appeal to the Hodge Theorem in Ted's answer. (Of course, that crucially relies on the orientability and compactness of $M$.)
Edit: It occurs to me that the point is that $\star$ interchanges $d$-closed and $d^\ast$-closed forms, i.e., $d \omega = 0$ iff $\star d \star \star \omega = \pm d^\ast (\star \omega) = 0$. Harmonic forms are precisely the forms that are both $d$-closed and $d^\ast$-closed; thus $\star$ is an automorphism of the space of harmonic forms.