Solution (source code)

= Solution

Treat $0$ as the trivial group if $G$ is not abelian. The restriction maps satisfy the presheaf identities. To verify the <sheaf gluing axiom>, take an <open cover> $(V_i)$ of $U$. If $x\notin U$, every section group is trivial. If $x\in U$, at least one $V_i$ contains $x$. Every two such opens have an overlap containing $x$, so compatibility forces all their sections to have the same value $g\in G$. Opens not containing $x$ have their unique trivial section. The value $g\in\mathcal G(U)$ is exactly the unique glued section. Thus \b[the stated presheaf is a skyscraper sheaf], including for nonabelian groups.

For the <stalk of a sheaf>, take the direct limit over neighbourhoods of $y$. If some neighbourhood $V$ of $y$ omits $x$, neighbourhoods inside $V$ are cofinal and all their groups are trivial. If every neighbourhood of $y$ contains $x$, every group in the system is $G$ and every transition map is the identity. Consequently, on the arbitrary <topological space> in the question,
$$
\boxed{\mathcal G_y\cong
\begin{cases}
G,&y\in\overline{\{x\}},\\
0,&y\notin\overline{\{x\}}.
\end{cases}}
$$
Membership in this <closure> means exactly that every neighbourhood of $y$ contains $x$. In particular $\mathcal G_x=G$. If $x$ is a <closed point>, the <closure> is just $\{x\}$ and the familiar point-supported answer results. The separation assumption is not present in the printed question, so it cannot be imposed silently.