The exercise for which I am seeking feedback wants me to prove that the center of a direct product is the direct product of the centers. That is, $$Z(G_1 \times \cdots \times G_n)=Z(G_1) \times \cdots \times Z(G_n).$$
Attempt at Solution: We proceed by induction on $n$. First, we prove our desired for $n=2$; this will establish our basis step. Let $(g_{1},g_{2}) \in Z(G_{1} \times G_{2})$. Then $(g_{1},g_{2})(x_{1},x_{2})=(x_{1},x_{2})(g_{1},g_{2})$ for all $(x_{1},x_{2}) \in G_{1} \times G_{2}.$ This implies $g_{1}x_{1}=x_{1}g_{1}$ and $g_{2}x_{2}=x_{2}g_{2}$ for all $x_{1} \in G_{1}$ and for all $x_{2} \in G_{2}$. Hence, $g_{1} \in Z(G_{1})$ and $g_{2} \in Z(G_{2})$. To prove the reverse inclusion, this time let $(g_{1},g_{2}) \in Z(G_{1}) \times Z(G_{2})$ Then, $g_{1}x_{1}=x_{1}g_{1}$ and $g_{2}x_{2}=x_{2}g_{2}$ for all $x_{1} \in G_{1}$ and for all $x_{2} \in G_{2}$; it, of course, follows that $(g_{1},g_{2})(x_{1},x_{2})=(x_{1},x_{2})(g_{1},g_{2})$ for all $(x_{1},x_{2}) \in G_{1} \times G_{2}.$ Indeed, $(g_{1},g_{2}) \in Z(G_{1} \times G_{2})$
For our induction step, assume that desired result holds for some $n$; that is, assume $$Z(G_1 \times \cdots \times G_n)=Z(G_1) \times \cdots \times Z(G_n).$$ We show $$Z(G_1 \times \cdots \times G_n \times G_{n+1})=Z(G_1) \times \cdots \times Z(G_n) \times Z(G_{n+1}).$$ By our basis step, $$Z(G_1 \times \cdots \times G_n \times G_{n+1})=Z(G_1 \times \cdots \times G_n) \times Z(G_{n+1}).$$ Then, using our induction hypothesis, we obtain $$Z(G_1 \times \cdots \times G_n) \times Z(G_{n+1})=Z(G_1) \times \cdots \times Z(G_n) \times Z(G_{n+1}).$$ Hence, our induction step has been established. Finally, by the principle of mathematical induction, we conclude $$Z(G_1 \times \cdots \times G_n)=Z(G_1) \times \cdots \times Z(G_n),$$ for any finite collection of groups $G_{1}, \ldots , G_{n}.$ $\blacksquare$
Question: This may be a stupid question; but, I'll ask anyway! Would it be wrong if I completed the proof by letting $(g_{1},\ldots , g_{n}) \in Z(G_1 \times \cdots \times G_n)$ and showing $(g_{1},\ldots , g_{n}) \in Z(G_1) \times \cdots \times Z(G_n)$? (Then, of course, proceed by proving the reverse inclusion.) Thank you!