The Question:
Suppose $G$ is a group and consider the product $r_1 r_2 r_3 \cdots r_n$, where for each $i$, $r_i$ is either an element of $G$ or a subset of $G$. Does the result depend on how we paranthesize this product? (We can assume that when all of the $r_i$ are group elements, parenthesizing the product in different ways doesn't change the result).
My Thoughts
I think the result does not depend on how we parenthesize.
I think (not sure again) that proving that $r_1 (r_2 r_3)=(r_1 r_2)r_3$ $(8$ cases at most$)$ is sufficient for the general result.
Here I write the proof for one of the cases; I think this proof can be applicable in each of the $8$ cases, but I would like to make sure I am not missing anything.
Let $G$ be a group, $A, B \subseteq G$, and $g \in G$.
$$A(gB)=\{ay|a \in A, y \in gB \}=\{a(gb)|a \in A, b \in B \}$$
$$=\{(ag)b|a \in A, b \in B \}=\{zb|z \in Ag, b \in B\}=(Ag)B$$
As Mohammad Riazi-Kermani states, it is enough to consider only the subset case since elements can be treated as singleton subsets. Proof sketch: Just expand the definition of $gS$ and $\{g\}S$ and compare, and similarly for the other way.
Then it is enough to only consider the associativity of the product of three subsets for exactly the same reasons we only need to consider the associativity of three elements to get arbitrary associativity.
Finally, we need to show that $(S_1 S_2)S_3 = S_1(S_2 S_3)$ which you can do by expanding out the definition of multiplying subsets twice on each side and using associativity of group elements. I'll leave spelling out the details to you.