Does connected components of a group scheme form a group scheme? Let $G$ be a group scheme locally finite type and smooth over a base scheme $S$, and assume $S$ is normal and integral.
Then does the set of (geometrical) connected components of a group scheme form a group? or even point of a group scheme over $S$?
If $S=Spec k $ where $k$ is a field, then this is true and we have a theory of $\pi_0(G)$ using etale algebras over a field. I wonder what will happen for the generic case.
 A: To make the answer self-consistent, I recall some notions. The direct answer is the bold part.

*

*When $S=\mathrm{Spec} k$ for a field $k$ and $G$ is just an $S$-group scheme, by [SGA3 I$_{\text{new}}$, VI$_{\text{A}}$, 2.6.5], there is a unique subgroup scheme $G^0\subset G$ whose underlying space is the irreducible component of $G$ containing the neutral section.


*When $S$ is local Artinian and $G$ is locally of finite type over $S$, then $G^0$ also exists ([SGA3 I$_{\text{new}}$, VI$_{\text{A}}$, 2.3]) as a subgroup scheme. If $G$ is further assumed to be $S$-flat, then the fpqc sheaf quotient $G/G^0$ is an $S$-etale group scheme; if $S$ is further assumed to be an algebraically closed field, then the set $\mathcal{C}$ of connected components is a $G/G^0$-torsor, namely $\mathcal{C}\simeq G/G^0$, so we obtain the desired identification.


*However, when $k$ is not separably closed, then by the above case, $\mathcal{C}$ will correspond to the set of $\mathrm{Gal}(k^{\mathrm{sep}}/k)$-orbits of $(G/G^0)(k^{\mathrm{sep}})$. For instance, $\mu_{3,\mathbf{Q}}=\mathbf{Q}[X]/(X^3-1)$ is a finite etale $\mathbf{Q}$-group scheme, but it has only two connected components: the neutral component $c_1$ and the other $c_2$ obtained by gluing $\zeta_3$ and $\zeta_3^{-1}$ together via the Galois action. The point is that there is no group structure on $\{c_1,c_2\}$ compatible with the group structure of $\mu_{3,\mathbf{Q}}$. (You can always endow a finite set with a group structure, but it will make the question meaningless: the compatibility is very important)

The following recollection is not directly relevant to the question, but I write here just for someone's convenience, especially who concerns about the existence of $G^0$.


*

*For a scheme $S$ and an $S$-group scheme $G$, denote by $\underline{G^0}$ the subset of $G$ as the union of $G^0_s$ for all $s\in S$, where $G^0_s$ is the connected component of $G_s$ containing the neutral section. By [SGA3 I$_{\text{new}}$, VI$_{\text{B}}$, 3.4], if $\underline{G^0}\subset G$ is an open subset, then the subfunctor
$$G^0\colon S^\prime/S\mapsto \{u\in G(S^\prime)|u(S^\prime)\subset \underline{G^0}\}$$
is representable by an $S$-subgroup scheme whose underlying space is $\underline{G^0}$.


*Indeed, when $G$ is an $S$-flat finitely presented group scheme, then [EGAIV$_3$, 15.6.5] implies that $\underline{G^0}$ is open in $G$. In particular, $G^0$ is an open $S$-group scheme of $G$.


*When $S$ is Noetherian of finite Krull dimension and $G$ is commutative smooth of finite type over $S$, then $G^0$ exists as an $S$-smooth finite type group and $G/G^0$ is an etale group algebraic space, see the paper of Giuseppe Ancona, Annette Huber and Simon Pepin Lehalleur, On the relative motive of a commutative group scheme.
A: I think that you should first ask whether $G^\circ$ even makes sense for a group over a relative base. What is it supposed to mean? Perhaps we should assume that $S$ is connected in which case we have that $G^\circ$ should be the connected component of $G$ containing the image of $e:S\to G$? This is not a very well-behaved notion--it doesn't even respect base change. For example, if you take $G=\mu_p$ over $\mathrm{Spec}(\mathbb{Z}_p)$ then then $G=G^\circ$, $G_{\mathbb{F}_p}=G_{\mathbb{F}_p}^\circ$ but $G_{\mathbb{Q}_p}^\circ$ is trivial!
