I would like to have some hints for the first part of the following exercise from Kosiowski, which asks to prove a quite general fact
First steps in algebraic topology. Let $X$ be a topological space and define $H(X)$ to be the set of continuous maps from $X$ to $\mathbb Z/2\mathbb Z$ with the discrete topology. If $f,g\in H(X)$, then define $f+g$ for all $x\in X$ by$$(f+g)(x)=f(x)+g(x)\pmod 2$$ Prove that $f+g$ is continuous and $H(X)$ is an abelian group with respect to this operation. Prove that $X$ is connected if and only if $H(X)$ is isomorphic to $\mathbb Z/2\mathbb Z$. Construct examples of topological spaces $X_k$ with $H(X_k)$ isomorphic to $(\mathbb Z/2\mathbb Z)^k$.
Moreover: I know that the set $\{0,1\}$ is a sort of dualizing object, for example inn the context of boolean algebras, and would like to know whether the same intuition about duality could be somehow applied here.
Continuous maps from $X$ to the two-point discrete space correspond one-to-one with the clopen subsets of $X$. The pointwise sum mod 2 then corresponds to the symmetric difference of two clopen subsets of $X$, which is easily seen to itself be clopen.
By definition, $X$ is connected if and only if it has exactly two clopen sets ($\emptyset$ and $X$), which means equivalently that the group $H(X)$ is cyclic of order 2.
Note that the empty space is not connected (similar to the trivial group not being simple, $1$ not being prime, the trivial ring not being an integral domain or field, the empty $G$-set for a group $G$ not being transitive, etc.). The general situation is referred to as "too simple to be simple" in the nLab.