Solution (source code)

= Solution

\b[The direct-sum assertion fails in both degrees when the pieces overlap.] Take genuine <open covers>, so the failure does not depend on any subtle choice of smooth structures on subsets.

For degree zero, let $M=\mathbb R$, $U=(-\infty,1)$ and $V=(-1,\infty)$. By <degree-zero de Rham cohomology>, $H^0_{\mathrm{dR}}$ consists of <locally constant functions>. Each of $M,U,V$ is connected and nonempty, so
$$
H^0_{\mathrm{dR}}(M)=\mathbb R,\qquad H^0_{\mathrm{dR}}(U)\oplus H^0_{\mathrm{dR}}(V)=\mathbb R^2.
$$
They are not isomorphic as real <vector spaces>. The restriction map is $c\mapsto(c,c)$; the overlap forces equality instead of allowing two independent constants.

For degree one, let $M=S^1$, and remove distinct points $a,b$ to form $U=S^1\setminus\{a\}$ and $V=S^1\setminus\{b\}$. Each is diffeomorphic to an <open interval>. Every one-form $f(t)dt$ on an interval has the smooth primitive $\int_{t_0}^t f(s)ds$, so both pieces have zero first <de Rham cohomology>. On the <circle>, the form $\eta=x\,dy-y\,dx$ is closed because all two-forms on a one-dimensional manifold vanish. The parameterization $(x,y)=(\cos t,\sin t)$ gives
$$
\int_{S^1}\eta=\int_0^{2\pi}dt=2\pi.
$$
An exact form has zero <integral> around this loop: the <integral> of $dF$ is the difference of the endpoint values of the periodic function $F$. Thus $[\eta]\ne0$, while the proposed right side is zero, disproving the isomorphism.

In fact $H^1_{\mathrm{dR}}(S^1)\cong\mathbb R$. For a periodic one-form $f(t)dt$, subtract $c\,dt$ where $c=(2\pi)^{-1}\int_0^{2\pi}f(t)dt$. The remainder has the periodic primitive $\int_0^t(f(s)-c)ds$, and hence is exact. This also explicitly identifies the nonzero class used above.