Prove: $ (G^{S},*)$ is abelian group if and only if $(G,\cdot )$ is abelian. 
Let $S \neq \emptyset $ and $(G,\cdot ) $ group. On set $G^{S} = \{ f \colon S \to G\}$  we define operation $*$ $$(f * g)(s) = f(s) \cdot g(s) , \forall s \in S.$$ Prove: $ (G^{S},*)$ is abelian group if and only if $(G,\cdot )$ is abelian.

I am having trouble with proving that $(G,\cdot )$ is abelian. If we choose $a,b \in G$ there is no guarantee that there will be $c,d \in S$ nor $f,g \in G^{S}$ so that $ a = f(c) $ and $ b = g(d) $, and even when that happens, how can we prove that $a \cdot b = b \cdot a $ (case $c \neq d) $. Am I missing something obvious? 
 A: $G^S$ is the space of all functions $S\to G$. So given any $a, b\in G$, there is an element $s\in S$ and functions $f, g:S\to G$ such that $f(s) =  a, g(s) = b$ (for instance, you can let $f$ and $g$ be suitable constant functions). Then since $f*g = g*f$ by assumption, we have
$$
a\cdot b = f(s)\cdot g(s) = (f*g)(s) = (g*f)(s) = g(s)\cdot f(s) = b\cdot a
$$
There is no need to have two different elements of $S$ for this. Translating between $\cdot $ and $*$ only works when both functions are fed the same input. So it makes sense to make sure that the two functions are fed the same input.
A: More structurally, we have a group homomorphism, embedding $G$ to the constant maps $S → G$,
$$\mathrm{const}\colon G → G^S,~g ↦ \operatorname{const} g$$
as well as for every $s ∈ S$ a group homomorphism
$$\mathrm{ev}_s\colon G^S → G,~f ↦ f(s),$$
so that obviously $\mathrm{ev}_s∘\mathrm{const} = \mathrm{id}_G$. So “$G^S$ abelian $\implies$ $G$ abelian” can be deduced by either that $\mathrm{ev}_s$ is surjective or that $\mathrm{const}$ is injective. You only need $S ≠ ∅$.
Furthermore: Since $\mathrm{ev}_s$ for $s ∈ S$ are all group homomorphisms, we also have a group isomorphism
$$\mathrm{ev}\colon G^S → \prod_{s ∈ S} G,~f ↦ (f(s))_{s ∈ S}.$$
Depending on what you already know about products and provided that $S ≠ ∅$, this already gives the desired equivalence “$G^S$ abelian $\iff$ G abelian”.
