I believe that your proof is incorrect. You assume that $g_{k+1}=g_{n-1}^{-1}$ and $g_{k+2}=g_{k+1}^{-1}$ which would imply that $g_{k+2}=g_{n-1}$, which does not seem to be what you intended.
Instead the proposition can be proven as follows:
LEMMA let $(G,\cdot)$ and $(H,\cdot)$ be abelian groups satisfying $\prod_{g\in G}g^2=1_G$ and $\prod_{h\in H}h^2=1_H$ then $\prod_{q\in G\times H}q^2=1_{G\times H}$.
proof: rewrite $q\in G\times H$ as $q=(g,h)$ with $g\in G$ and $h\in H$. Then the product can be rewritten as follows
\begin{align}
\prod_{q\in G\times H}q^2&=\prod_{g\in G}\prod_{h\in H}(g,h)^2\\
&=\prod_{g\in G}\prod_{h\in H}(g^2,h^2)\\
&=\prod_{g\in G}\left(g^2,\prod_{h\in H}h^2\right)\\
&=\prod_{g\in G}(g^2,1_H)\\
&=\left(\prod_{g\in G}g^2,1_H\right)\\
&=(1_G,1_H)\\
&=1_{G\times H}
\end{align} $\blacksquare$
The main proposition can then be proven using the structure theorem for finite abelian groups.
proposition Let $(G,\cdot)$ be a finite abelian group. Then $\prod_{g\in G}g^2=1$.
proof: since $G$ is a finite abelian group it follows from the structure theorem for finite abelian groups that, for some $n\in \mathbb N$, there are prime numbers $p_1,p_2,\ldots,p_n$ and natural numbers $k_1,k_2,\ldots,k_n$ such that
$$G\cong \mathbb Z_{p_1^{k_1}}\times\mathbb Z_{p_2^{k_2}}\times\cdots\times\mathbb Z_{p_n^{k_n}}.$$
Define $\varphi_1,\varphi_2,\ldots,\varphi_n$ by $\varphi_i:\mathbb Z\to\mathbb Z_{p_i^{k_i}}$ where $\varphi_i:m\mapsto [m]_{p_i^{k_i}}$ for all $1\leq i\leq n$, notice also that all the $\varphi_i$'s are group homomorphisms.
It is then seen that, for all $1\leq i\leq n$, it holds that
\begin{align}
\varphi_i\left(\sum_{j=1}^{p_i^{k_i}-1}2j\right)&=\varphi_i \left(2\sum_{j=1}^{p_i^{k_i}-1}j\right)\\
&=\varphi_i\left(2\cdot\frac{p_i^{k_i}(p_i^{k_i}-1)}{2}\right)\\
&=\varphi_i(p_i^{k_i}(p_i^{k_i}-1))\\
&=[p_i^{k_i}(p_i^{k_i}-1)]_{p_i^{k_i}}\\
&=[0]_{p_i^{k_i}}.
\end{align}
It is then seen that all the $\mathbb Z_{p_1^{k_1}},\mathbb Z_{p_2^{k_2}},\ldots,\mathbb Z_{p_n^{k_n}}$ satisfy the product property described in the above lemma, and since $G$ is isomorphic to their product it the follows by the lemma that $G$ also obeys the product property. $\blacksquare$