Subgroup scheme of a constant group scheme I am studying the basics of group-schemes, and I found this statement in a book.

Let $A$ be a finite abelian group, and let $S$ be a connected scheme. We denote by $(A)_S$ the constant group scheme associated to $A$ over $S$. Let $G/S$ be a subgroup scheme of $(A)_S/S$. Then $G$ is a constant group scheme over $S$.  

This looks rather basic but it is actually bugging me. Here is what I've done.  
Because $S$ is connected, we know that the group $A(S)$ of sections of $(A)_S$ is isomorphic to $A$. It follows, by definition, that $G(S)$ is a subgroup of $A$, which we denote $K$. I would like to show that $G$ is none other than the constant group scheme $(K)_S$. 
For this, I need to show that for any scheme $T$ over $S$, the group of $T$-points of $G$ over $S$, denoted $G_S(T)$, is isomorphic to the group of locally constant functions from $T$ to $K$ (equipped with the discrete topology). By definition, we already know that $G_S(T)$ is a subgroup of the group of locally constant functions from $T$ to $A$. 
Then, I do not know how to continue further. Namely, I would like to show that any point of $G_S(T)$ maps $T$ to $K$, and that any such locally constant function belongs to $G_S(T)$.  
Is the way I am proceeding correct? Is there another way of prooving the statement? Any hint or sketch of the proof would be gladly appreciated. 
Thank you very much.
 A: Maybe my attempt is a little too envolved, but this is how I would do it, at least in the case where $S$ is noetherian (using as much category theory and as little scheme theory as possible):
Let $G(S)=G \subseteq A$. By the Yoneda Lemma it suffices to show that for every $S$-scheme $H \rightarrow S$ with a section $S \rightarrow H$ we have $G(H)=G^{\pi_0(G)}$. If $S$ is noetherian, we can restrict to noetherian $H$ and therefore reduce to the case where $H$ is connected (because then $H$ is the coproduct of its connected components).
By functoriality we have a morphism $G= G(S) \rightarrow G(H) \subseteq A(H)=A(S)=A$. On the other hand, from the section, we get a surjection $G(H) \rightarrow G(S)$, inducing (by the subfunctor property) a commutative diagram
$$\require{AMScd} \begin{CD} G(H) @>{incl}>> A \\ @VVV @VVV \\ G(S) @>{incl}>> A \end{CD}$$
where the right hand side is just the identity map. Showing that $G(H) \rightarrow G(S)$ is also the identity map.
For the case where $S$ is not noetherian:
Let $H= \bigcup_I H_i$ where the $H_i$ are the connected components (note that this is not necessarily the coproduct on $S$-schemes). Let $H' = \coprod_I H_i$. The canonical morphism $H' \rightarrow H$ induces the identity on $A(H) \rightarrow A(H')$, thus an injection $G(H) \rightarrow G(S)^I$ and therefore we obtain a functorial injection $G \rightarrow G(S)$, yielding $G$ as a subgroup scheme of $G(S)$, where I write $G(S)$ for the constant group scheme. Thus, we are reduced to the case "if $G$ is a subgroup scheme of a finite constant group scheme $A$ with $G(S)=A(S)$, then $G=A$". 
Then we can write $G= \coprod_{a \in A(S)} X_a$ where the $X_a$ are maybe not connected $S$-schemes and have an $S$-section. We want to show that every such $X_a$ is connected (then we are done!). Assume $X_a = X_1 \cup X_2 \cup X_3$, where $X_1$ is the connected component containing $S$ and $X_2$ is connected. But then $G$ has at least $|A(S)|+1$-many $X_2$-valued points, which is a contradiction. Showing the $X_a$ are connected and (a postiori) isomorphic to $S$.
