Scheme representing locally continuous maps Let $\Lambda$ be a discrete finite group. Set $X_\Lambda:= \bigsqcup_{a \in \Lambda} X_a$, i.e. $\Lambda$-copies of a scheme $X$.
Then it is claimed in page 46 that this scheme reprenets in the cat. of $Schemes_{/X}$ the functor
$$ Schemes_{/X} \rightarrow Set$$
$$U \mapsto \Lambda ^{\pi_0 U}$$,
where $\pi_0 Y$ is set of components of the underlying topological space of $Y$.  I would appreciate if someone explain how this works.

I have written my thoughts below which one may safely ignroe.

So I took the basic case when $X=Spec \Bbb Z$. I see that
$$ U \rightarrow \bigsqcup Spec \Bbb Z$$
has
i) as underlying of spaces  locally constant maps $U \rightarrow \Bbb Z$, which is equivalent to  $\pi_0U \rightarrow \Lambda$
ii) But as scheme, we have to take account of the structure sheaf - which seems to be complicated for me.

On the other hand we also have the alternate expression
$$Hom_{Sch}(U, \bigsqcup Spec \Bbb Z) \simeq Hom_{Rng}(\Bbb Z \times \cdots \times \Bbb Z, O_U(U))  $$
In both attempts, I am able too see the why $X_\Lambda$ represents the functor.
 A: In the absolute case you consider:
There is no problem with either of the two formulations. $\mathrm{Spec}\,\mathbb{Z}$ is a final object in the category of schemes, and so you don't need to argue too much about what the maps $U \rightarrow \mathbb{Z}$ are - there is just one such map. Once you decompose $U$ as a disjoint union of its components, you will see the bijection rather quickly (in a map $U' \rightarrow \coprod \mathrm{Spec}\,\mathbb{Z}$ where $U'$ is connected, one just needs to pick one of the copies of $\mathrm{Spec}\,\mathbb{Z}$ where the image lands, and the induced map needs to be the unique one).
In the formulation $\mathrm{Ring}(\mathbb{Z} \times \dots \times \mathbb{Z}, \mathcal{O}_U(U)),$ one can observe that any such ring hom. is determined by the images $e_\lambda$ of the "canonical vectors" $(0, 0, \dots, 1, 0, \dots, 0).$ As these canonical vectors multiply pairwise to $0$ and sum up altogehter to $1$, the relations that these $e_\lambda$'s need to satisfy are $e_\lambda e_{\lambda'}=0$ when $\lambda \neq \lambda', e_{\lambda}^2=e_{\lambda}$ and $\sum_\lambda e_\lambda=1$. That is, the homs correspond precisely to complete families $(e_\lambda)_\lambda$ of orthogonal idempotents in $\mathcal{O}_U(U)$ indexed by $\Lambda$. It is not hard to see from this description that these are in bijection with $\Lambda^{\pi_{0}(U)}$.
In the general case: The situation is quite similar due to the fact that the morphisms one considers are over $X$.
In more detail: the constant (group) scheme $\coprod_{\lambda \in \Lambda}X_{\lambda}$ is implicitly endowed with a structure map $\coprod_{\lambda \in \Lambda}X_{\lambda}\stackrel{\nabla}\rightarrow X$ given by the identity map $X_\lambda \rightarrow X$ on each component. The represented functor then takes a scheme $U$ over $X$, $U \stackrel{f}{\rightarrow}X$, to the set of all morphisms $U \stackrel{g}\rightarrow \coprod_{\lambda \in \Lambda}X_{\lambda}$ over $X$, i.e. such that $\nabla \circ g = f$.
Here is the full argument if you are interested. You can see that it uses only very little information about schemes per se (namely the underlying topology + the fact that connected components give decomposition as coproduct of schemes):
First suppose that $U$ is connected. Then, just by topology, $U$ is necessarily mapped into one of the copies $X_{\lambda_0}$ by such map $g$. But then, as the restriction of $\nabla$ to $X_{\lambda_0}$ is just the identity on $X$, it follows that the "corestricted" map $U \rightarrow X_{\lambda_0}$ is just $f$. Conversely, any choice of $\lambda_0$ gives a unique such $g$ given as $U \stackrel{f}\rightarrow X_{\lambda_0} \hookrightarrow \coprod_{\lambda} X_{\lambda}.$ Therefor in this case the functor gives what it should, i.e. $\Lambda^1$.
In general, consider the decomposition $U=\coprod_{i \in \pi_0(U)} U_i$ of $U$ into its connected components and let $f_i$ be the restriction of $f$ to $U_i$. Then it is easy to see that $U$ is the coproduct of such $U_i$'s even in the category of schemes over $X$ (where $U_i$ has the structure of an $X$-scheme given by $f_i$), and we have
$$\mathrm{Sch}_X(U, \coprod_{\lambda}X_\lambda)=\mathrm{Sch}_X(\coprod_{i \in \pi_0(U)} U_i, \coprod_{\lambda}X_\lambda)=\prod_{i \in \pi_0(U)}\mathrm{Sch}_X(U_i, \coprod_{\lambda}X_\lambda)=\prod_{i \in \pi_0(U)}\Lambda=\Lambda^{\times \pi_0(U)},$$
using the universal property of coproduct in the middle step. Thus, the claim is true in the general case as well.
