The forgetful functor $U : \mathsf{Ab} \to \mathsf{Set}$ is monadic, this follows from Beck's monadicity theorem or some other general result. Anyway, I would like to prove this directly, thereby solving an exercise in Mac Lane's Categories for the working mathematician. This amounts to prove an equivalent definition of an abelian group, using $\mathbb{Z}$-linear combinations of arbitrary length, which should be quite elementary. But working through the details, I get stuck at some point.
First, let me describe the monad $T: \mathsf{Set} \to \mathsf{Set}$ corresponding to $U$. It maps a set $X$ to the set $T(X)$ of functions $\lambda : X \to \mathbb{Z}$ with finite support. If $f : X \to Y$ is a map, then $T(X) \to T(Y)$ sends $\lambda$ to the function $y \mapsto \sum_{x \in f^{-1}(y)} \lambda(x)$. The unit $\eta : \mathrm{id} \to T$ sends $x \in X$ to the function supported at $x$ with value $1$. The multiplication $\mu : T^2 \to T$ maps $\alpha \in T^2(X)$ to $\mu(\alpha) \in T(X)$ defined by $\mu(\alpha)(x)=\sum_{\lambda \in T(X)} \alpha(\lambda) \cdot \lambda(x)$.
It follows that a $T$-module may be described as follows: This is a set $X$ together with a map $h : T(X) \to X$, which I will denote by $f \mapsto \sum_{x \in X} f(x) \cdot x$, such that the following properties hold:
1) If $f \in T(X)$ is supported at $x_0 \in X$ with value $1$, then $\sum_{x \in X} f(x) \cdot x = 1$.
2) For every $\alpha \in T(T(X))$ we have an equality
$$\sum_{x \in X} \Bigl(\sum_{\lambda \in T(X)} \alpha(\lambda) \cdot \lambda(x)\Bigr) \cdot x = \sum_{x \in X} \Bigl(\sum_{\lambda \in T(X), \sum\limits_{y \in X} \lambda(y)=x} \alpha(\lambda)\Bigr) \cdot x$$
From the notation it is clear how the comparison functor $\mathsf{Ab} \to \mathsf{Mod}(T)$ looks like. Conversely, let $(X,h)$ be a $T$-module. Then I would like to define a binary operation $+$ on $X$ roughly by $x+y = 1 \cdot x + 1 \cdot y + 0 \cdot ? + \dotsc$. Unfortunately, the precise definition requires a case distinction! First, define $0_X := \sum_{x \in X} 0 \cdot x$. Then, for $x,y \in X$, define
$$x+y :=\begin{cases} \sum_{z \in X} \delta_{z,\{x,y\}} \cdot z & x \neq y\\ \sum_{z \in X} (2 \cdot \delta_{z,x}) \cdot z & x = y \neq 0_M \\ 0_M & x=y=0_M \end{cases}$$
With such a definition, it seems to be very hard to prove associativity. Or is there an elegant proof? Or a better definition of $+$?