I'm reading about $T$-algebras, defined as a pair of an object $c$ and a morphism $f:Tc \to c$, where $T$ is an endofunctor.
It can be shown that it's a generalization of algebraic structures. For example is $G$ is a group, then, in category of sets and functions that group is $(G, f:1 + G + G \times G \to G)$, where $+$ is a coproduct and $\times$ is a product (so $T$ is a functor $G \mapsto 1 + G + (G \times G)$).
My question is, for example, if we take a ring, the functor becomes $G \mapsto 1 + 1 + G + (G \times G) + (G \times G)$. Aren't in category of sets and functions coproducts disjoint unions? If so, how could $(G \times G) + (G \times G)$ be a valid construction?
There is no issue with taking the disjoint union of twice the same set (so with your notation, something like $A+A$).
When we say that $A+B$ is the disjoint union of $A$ and $B$, in this context it does not mean that $A$ and $B$ are disjoint sets, and $A+B$ is their usual union. Instead, the disjoint union is a special operation, which is precisely defined to be able to "make non-disjoint sets disjoint". When you take $A+B$, you actually take copies of $A$ and $B$ which are made to be disjoint, even if $A=B$ for instance. One standard way to do that is to take some fixed set with two elements, say $\{0,1\}$, and to define $$A+B = (A\times\{0\})\cup (B\times\{1\})\subset (A\cup B)\times \{0,1\}.$$
That way, even if $A$ and $B$ have a non-empty intersection (in fact, even if they are equal), you can distinguish the two copies because if $x\in A\cap B$, $x$ corresponds to two elements $(x,0)$ and $(x,1)$ in $A+B$ which are really distinct. We then say that $(x,0)$ is the copy of $x$ in the $A$ component of $A+B$, and $(x,1)$ is the copy in the $B$ component.
But this is just an example of construction, it does not matter how the sausage is made under the hood, what matters is that there are two canonical injections $i_A:A\to A+B$ and $i_B:B\to A+B$, such that $i_A(A)\cap i_B(B)=\emptyset$ and $i_A(A)\cup i_B(B)=A+B$. In the previous construction, $i_A(x)=(x,0)$ and $i_B(x)=(x,1)$.