Let $G_1=G_2=\dots=G_n$, and let $G=G_1 \times G_2 \times \cdots G_n$. For a permutation $\pi \in S_n$ define $$\varphi_\pi:G \to G$$ according to the rule $$\varphi_\pi(g_1,\dots,g_n)=(g_{\pi^{-1}(1)},\dots,g_{\pi^{-1}(n)}). $$ I'm required to prove that $\Phi:\pi \mapsto \varphi_\pi $ is a homomorphism. Here is my (failed) attempt:
We see how $\Phi(\pi_1 \pi_2)$ acts on a general element $g=(g_1,\dots,g_n)$ of the product:
$$ \begin{align*} \Phi(\pi_1 \pi_2)(g) &= \varphi_{\pi_1 \pi_2}(g_1,\dots,g_n) \\ &= (g_{(\pi_1 \pi_2)^{-1} (1)},\dots,g_{(\pi_1 \pi_2)^{-1}(n)})\\ &= (g_{\pi_2^{-1}(\pi_1^{-1}(1))},\dots,g_{\pi_2^{-1}(\pi_1^{-1}(n))}) \\ &= \varphi_{\pi_2}(g_{\pi_1^{-1}(1)},\dots,g_{\pi_1^{-1}(n)}) \\ &= \varphi_{\pi_2} \circ \varphi_{\pi_1}(g) \\ &= \left(\Phi(\pi_2) \circ \Phi(\pi_1) \right)(g) \end{align*}$$
I seem to have gotten $\Phi(\pi_1 \pi_2)=\Phi(\pi_2) \Phi(\pi_1)$ rather than the usual homomorphism law. Where have I gone wrong?
P.S.
The way I see it, applying $\varphi_\pi$ to an $n$-tuple means, applying the inverse permutation $\pi^{-1}$ to each of the subscripts. Could this be my problem?
It is easier to work backward.
You can think of the $k^\text{th}$ element of $\phi_\pi(\mathbf{g})$ as taking the $\pi^{-1}(k)$-th element of $\mathbf{g}$.
So $\phi_{\pi_1}(\phi_{\pi_2}((g_1,g_2,\ldots,g_n)))=\phi_{\pi_1}((g_{\pi_2^{-1}(1)},g_{\pi_2^{-1}(2)},\ldots,g_{\pi_2^{-1}(n)}))$
And then the $k^\text{th}$ element of the result will be the $\pi_1^{-1}(k)$-th element of that in the brackets, which is $g_{\pi_2^{-1}(\pi_1^{-1}(k))}$.
So $\phi_{\pi_1}((g_{\pi_2^{-1}(1)},g_{\pi_2^{-1}(2)},\ldots,g_{\pi_2^{-1}(n)}))=(g_{\pi_2^{-1}(\pi_1^{-1}(1))},g_{\pi_2^{-1}(\pi_1^{-1}(2))},\ldots,g_{\pi_2^{-1}(\pi_1^{-1}(n))})$.