[proofplan]
We compute de Rham cohomology by first choosing a finite CW decomposition of the genus-$g$ surface and computing its cellular cohomology over $\mathbb{R}$. For $g=0$ we use the standard CW decomposition of $S^2$ with one $0$-cell and one $2$-cell; for $g\geq 1$ we use the usual $4g$-gon model with one $0$-cell, $2g$ one-cells, and one $2$-cell. In both cases the cellular boundary maps vanish: vacuously in degree $1$ when $g=0$, and by cancellation in the commutator attaching word when $g\geq 1$. The cellular cochain differential is therefore zero in every relevant degree, and the de Rham comparison theorem transfers the resulting cellular cohomology groups to de Rham cohomology.
[/proofplan]
[step:Choose the standard cellular model of the genus-$g$ surface]
By the classification of compact connected oriented smooth surfaces, $\Sigma_0$ is diffeomorphic to $S^2$, and for $g\geq 1$, $\Sigma_g$ is diffeomorphic to the quotient of a polygon with $4g$ oriented sides identified according to the word
\begin{align*}
a_1 b_1 a_1^{-1} b_1^{-1} \cdots a_g b_g a_g^{-1} b_g^{-1}.
\end{align*}
For $g=0$, use the CW decomposition of $S^2$ with one $0$-cell, denoted $v$, no one-cells, and one $2$-cell, denoted $e$, attached by the constant map from $S^1$ to $v$. For $g\geq 1$, the polygon quotient gives a CW decomposition of $\Sigma_g$ with one $0$-cell, denoted $v$, with $2g$ one-cells, denoted
\begin{align*}
a_1,b_1,\dots,a_g,b_g,
\end{align*}
and with one $2$-cell, also denoted $e$.
Let $C_k(\Sigma_g;\mathbb{R})$ denote the cellular chain group of this CW complex with real coefficients. Then
\begin{align*}
C_0(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle v\rangle,\\
C_1(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle a_1,b_1,\dots,a_g,b_g\rangle \cong \mathbb{R}^{2g},\\
C_2(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle e\rangle \cong \mathbb{R},
\end{align*}
and
\begin{align*}
C_k(\Sigma_g;\mathbb{R})=0
\end{align*}
for every integer $k>2$.
[guided]
There are two cases hidden in the phrase "genus $g$ surface." When $g=0$, the surface is $S^2$, and the standard CW model has one vertex $v$, no one-cells, and one two-cell $e$ attached by the constant map $S^1 \to \{v\}$. When $g\geq 1$, the geometric input is the standard polygon model for the oriented genus-$g$ surface. The boundary of the polygon is labeled by the word
\begin{align*}
a_1 b_1 a_1^{-1} b_1^{-1} \cdots a_g b_g a_g^{-1} b_g^{-1}.
\end{align*}
Identifying sides with the same label and opposite orientations produces the compact connected oriented surface $\Sigma_g$.
For $g\geq 1$, this quotient has one vertex because all polygon vertices are identified. It has one one-cell for each label $a_i$ and $b_i$, so there are $2g$ one-cells. It has one two-cell, namely the image of the polygon interior. The formula below also covers $g=0$, because then $\mathbb{R}^{2g}=\mathbb{R}^0=0$ and the displayed list of one-cells is empty. Thus, if $C_k(\Sigma_g;\mathbb{R})$ denotes the cellular chain group with real coefficients, then
\begin{align*}
C_0(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle v\rangle,\\
C_1(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle a_1,b_1,\dots,a_g,b_g\rangle \cong \mathbb{R}^{2g},\\
C_2(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}\langle e\rangle \cong \mathbb{R}.
\end{align*}
There are no cells of dimension greater than $2$, so
\begin{align*}
C_k(\Sigma_g;\mathbb{R})=0
\end{align*}
for every integer $k>2$.
[/guided]
[/step]
[step:Compute the cellular boundary maps]
Let
\begin{align*}
\partial_k:C_k(\Sigma_g;\mathbb{R}) \to C_{k-1}(\Sigma_g;\mathbb{R})
\end{align*}
denote the cellular boundary map. Since every one-cell begins and ends at the unique $0$-cell $v$, the cellular boundary of each one-cell is $v-v=0$. Hence
\begin{align*}
\partial_1=0.
\end{align*}
It remains to compute $\partial_2(e)$. If $g=0$, then $C_1(\Sigma_0;\mathbb{R})=0$, so the map $\partial_2:C_2(\Sigma_0;\mathbb{R})\to C_1(\Sigma_0;\mathbb{R})$ has zero codomain and hence $\partial_2(e)=0$. If $g\geq 1$, the coefficient of a one-cell in $\partial_2(e)$ is the total signed number of times that the attaching map of $e$ traverses that one-cell. In the attaching word, each $a_i$ occurs once with positive orientation and once with negative orientation, and each $b_i$ occurs once with positive orientation and once with negative orientation. Therefore every signed coefficient is zero, and
\begin{align*}
\partial_2(e)=0.
\end{align*}
Thus
\begin{align*}
\partial_1=0,
\qquad
\partial_2=0.
\end{align*}
[guided]
We now compute the cellular differentials. Let
\begin{align*}
\partial_k:C_k(\Sigma_g;\mathbb{R}) \to C_{k-1}(\Sigma_g;\mathbb{R})
\end{align*}
be the cellular boundary map. First consider $\partial_1$. Every one-cell has both endpoints at the same unique $0$-cell $v$. The cellular boundary of an oriented one-cell is its terminal vertex minus its initial vertex, so each one-cell has boundary $v-v=0$. Therefore
\begin{align*}
\partial_1=0.
\end{align*}
For the two-cell, there are again two cases. If $g=0$, then $C_1(\Sigma_0;\mathbb{R})=0$, so the boundary map
\begin{align*}
\partial_2:C_2(\Sigma_0;\mathbb{R}) \to C_1(\Sigma_0;\mathbb{R})
\end{align*}
has zero codomain. Hence $\partial_2(e)=0$ in the sphere case.
If $g\geq 1$, the cellular boundary is determined by the attaching map of the polygon boundary. The coefficient of a one-cell in $\partial_2(e)$ is the signed number of times the attaching map traverses that one-cell. The attaching word is
\begin{align*}
a_1 b_1 a_1^{-1} b_1^{-1} \cdots a_g b_g a_g^{-1} b_g^{-1}.
\end{align*}
For each index $i \in \{1,\dots,g\}$, the letter $a_i$ appears once as $a_i$ and once as $a_i^{-1}$, so its total signed coefficient is $1-1=0$. The same computation applies to $b_i$, whose total signed coefficient is also $1-1=0$. Hence every coefficient in $\partial_2(e)$ vanishes, and therefore
\begin{align*}
\partial_2(e)=0.
\end{align*}
Since $C_2(\Sigma_g;\mathbb{R})$ is generated by $e$, this gives
\begin{align*}
\partial_2=0.
\end{align*}
Together with the previous computation,
\begin{align*}
\partial_1=0,
\qquad
\partial_2=0.
\end{align*}
[/guided]
[/step]
[step:Pass to cellular cochains and compute cellular cohomology]
Let
\begin{align*}
C^k(\Sigma_g;\mathbb{R}) := \operatorname{Hom}_{\mathbb{R}}(C_k(\Sigma_g;\mathbb{R}),\mathbb{R})
\end{align*}
be the cellular cochain group, and let
\begin{align*}
\delta^k:C^k(\Sigma_g;\mathbb{R}) \to C^{k+1}(\Sigma_g;\mathbb{R})
\end{align*}
be the cellular coboundary map, defined by precomposition with $\partial_{k+1}$. Since $\partial_1=0$ and $\partial_2=0$, we have
\begin{align*}
\delta^0=0,
\qquad
\delta^1=0.
\end{align*}
Also,
\begin{align*}
C^0(\Sigma_g;\mathbb{R}) &\cong \mathbb{R},\\
C^1(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}^{2g},\\
C^2(\Sigma_g;\mathbb{R}) &\cong \mathbb{R},
\end{align*}
and $C^k(\Sigma_g;\mathbb{R})=0$ for every integer $k>2$.
Therefore the cellular cohomology groups are
\begin{align*}
H^0_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
&=\ker \delta^0
\cong \mathbb{R},\\
H^1_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
&=\ker \delta^1 / \operatorname{im}\delta^0
\cong \mathbb{R}^{2g},\\
H^2_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
&=C^2(\Sigma_g;\mathbb{R})/\operatorname{im}\delta^1
\cong \mathbb{R},
\end{align*}
and
\begin{align*}
H^k_{\mathrm{cell}}(\Sigma_g;\mathbb{R})=0
\end{align*}
for every integer $k>2$.
[guided]
Cohomology is computed from cochains, so we dualize the cellular chain complex. Define
\begin{align*}
C^k(\Sigma_g;\mathbb{R}) := \operatorname{Hom}_{\mathbb{R}}(C_k(\Sigma_g;\mathbb{R}),\mathbb{R}).
\end{align*}
The coboundary map
\begin{align*}
\delta^k:C^k(\Sigma_g;\mathbb{R}) \to C^{k+1}(\Sigma_g;\mathbb{R})
\end{align*}
is defined by precomposition with the cellular boundary:
\begin{align*}
\delta^k(\varphi)=\varphi \circ \partial_{k+1}
\end{align*}
for every $\varphi \in C^k(\Sigma_g;\mathbb{R})$. Since we proved that
\begin{align*}
\partial_1=0,
\qquad
\partial_2=0,
\end{align*}
it follows directly that
\begin{align*}
\delta^0=0,
\qquad
\delta^1=0.
\end{align*}
The cellular cochain groups have the same finite dimensions as the cellular chain groups:
\begin{align*}
C^0(\Sigma_g;\mathbb{R}) &\cong \mathbb{R},\\
C^1(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}^{2g},\\
C^2(\Sigma_g;\mathbb{R}) &\cong \mathbb{R}.
\end{align*}
Because there are no cells above dimension $2$,
\begin{align*}
C^k(\Sigma_g;\mathbb{R})=0
\end{align*}
for every integer $k>2$.
Now compute cohomology degree by degree. In degree $0$,
\begin{align*}
H^0_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
=\ker \delta^0
=C^0(\Sigma_g;\mathbb{R})
\cong \mathbb{R}.
\end{align*}
In degree $1$,
\begin{align*}
H^1_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
=\ker \delta^1/\operatorname{im}\delta^0
=C^1(\Sigma_g;\mathbb{R})/0
\cong \mathbb{R}^{2g}.
\end{align*}
In degree $2$,
\begin{align*}
H^2_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
=C^2(\Sigma_g;\mathbb{R})/\operatorname{im}\delta^1
=C^2(\Sigma_g;\mathbb{R})/0
\cong \mathbb{R}.
\end{align*}
Finally, for $k>2$, the cochain group $C^k(\Sigma_g;\mathbb{R})$ is zero, so
\begin{align*}
H^k_{\mathrm{cell}}(\Sigma_g;\mathbb{R})=0.
\end{align*}
[/guided]
[/step]
[step:Transfer the cellular calculation to de Rham cohomology]
By the de Rham-cellular comparison theorem for smooth manifolds admitting finite CW decompositions, the real de Rham cohomology of $\Sigma_g$ is naturally isomorphic to the real cellular cohomology of the above CW complex. The hypotheses apply because $\Sigma_g$ is a compact smooth surface and the polygon construction gives a finite CW decomposition. Thus
\begin{align*}
H^k_{\mathrm{dR}}(\Sigma_g) \cong H^k_{\mathrm{cell}}(\Sigma_g;\mathbb{R})
\end{align*}
for every integer $k\geq 0$.
Combining this comparison with the cellular computation gives
\begin{align*}
H^0_{\mathrm{dR}}(\Sigma_g)&\cong \mathbb{R},\\
H^1_{\mathrm{dR}}(\Sigma_g)&\cong \mathbb{R}^{2g},\\
H^2_{\mathrm{dR}}(\Sigma_g)&\cong \mathbb{R},
\end{align*}
and
\begin{align*}
H^k_{\mathrm{dR}}(\Sigma_g)=0
\end{align*}
for every integer $k>2$. This is the desired computation.
(citing a result not yet in the wiki: de Rham-cellular comparison theorem)
[/step]