Concentrated schemes are closed under finite gluings Let $X$ be a scheme. Assume that $X = \cup_i X_i$ is finite open covering, such that the $X_i$ as well as their intersections $X_i \cap X_j$ are concentrated, i.e. quasi-compact and quasi-separated (see Daniel Murfet's notes on concentrated schemes as well as EGA IV.1). Does it follow that $X$ is concentrated? I'm almost embarrassed to ask this question.

Clearly $X$ is quasi-compact, as a finite union of quasi-compact subspaces. In order to show that $X$ is quasi-separated, it suffices to show that for open affines $U \subseteq X_i$ and $V \subseteq X_j$ their intersection $U \cap V$ is quasi-compact. Well this is clear for $i=j$ since $X_i$ is quasi-separated. But what happens for $i \neq j$? Somehow we have to use that $X_i \cap X_j$ is quasi-compact.

Here is a more abstract idea: We have to show that $\Delta : X \to X \times X$ is a quasi-compact morphism. This can be checked locally on the base, hence it suffices to prove that the morphisms $X_i \cap X_j \to X_i \times X_j$ are quasi-compact. Well, $X_i \cap X_j$ is quasi-compact, hence by (EGA IV, 1.1.2 (v)) it would suffice that $X_i \times X_j$ is separated. But we don't assume that the $X_i$ are separated, they are just quasi-separated.

Note that actually EGA IV.1.2.7.c proves the claim, but I don't understand the proof. Here is my translation: "We know that in order to prove that $\Delta : X \to X \times X$ is quasi-compact, it suffices to prove that the inverse images $X_i \cap X_j$ of the $X_i \times X_j$ are quasi-compact (1.1.1)". Here, (1.1.1) is just the definition of a quasi-compact morphisms, after which it is remarked that it suffices to prove this with respect to an affine(!) open covering. But here, we just have an open covering consisting of quasi-compact schemes. This seems to be a gap?

Or does the following statement hold (which we could then apply to $\Delta$)? If $f : X \to Y$ is a morphism and $Y$ is covered by quasi-compact open subsets $Y_i$ such that each $f^{-1}(Y_i)$ is quasi-compact, then $f$ is quasi-compact. I doubt that this is true without any assumption on $Y$.

Edit. Sorry I think now I can answer my question. The treatment of quasi-compact morphisms is better in EGA I (1970), §6. Specifically, in order to show that $X_i \cap X_j \to X_i \times X_j$ is quasi-compact, it suffices that $X_i \cap X_j$ is quasi-compact and $X_i \times X_j$ is quasi-separated by Prop. 6.1.5. (v), and we have both. Note that EGA VI.1.2.7 is reproduced as EGA I.6.1.12, but still the end just refers to the definition of quasi-compact morphisms, which doesn't seem to suffice?

So what about a more direct proof, showing directly that (with the notation above) $U \cap V$ is quasi-compact? One can spell out the proof above as follows (still quite tricky):

$X_i \cap X_j \to (X_i \cap X_j) \times (X_i \times X_j)$ is a base change of the diagonal of $X_i \times X_j$, which is quasi-compact, hence it is also quasi-compact. Since $U \cap V$ is the preimage of the quasi-compact open subscheme $(X_i \cap X_j) \times (U \times V)$, it is quasi-compact.

(Usually I delete a question when I solve it quickly before an answer arrives, but this time I won't because it has already some upvotes and therefore seems to be interesting for others, too. Besides, I would like to know if you also agree that the EGA proof has a gap.)
The problem is roughly the result in the picture below from EGA I.6.1.12 p.296 (Springer 1971).

I claim that the condition d) is not sufficient to imply a) (so EGA I.6.1.12 is not correct as stated). As a counterexample, let take $X$ to be the infinite dimensional affine space over a field with double origin, as Exercise 10.11 in Algebraic geometry I by Görtz-Wedhorn:and we take all $U_{\alpha}$ to be the quasi-compact scheme $X$ itself, then d) holds but a) does not. See also a comment in [Görtz-Wedhorn, Remark 10.2 (4)] for a related issue on quasi-compactness.
So you don't want to choose the $X_i$ to be affine from the beginning? Maybe that's a work around for your last question if you assume $Y$ to be quasi-compact.

Let $f \colon X \to Y$ be a morphism and $Y = \bigcup_{i \in I} Y_i$ with $Y_i$ quasi-compact and $I$ finite. Let $Y_i = \bigcup_{j \in J} Z_j^{(i)}$ where  the $Z_j^{(i)}$ are affine and $J = J(i)$ can be chosen to be finite. Since
$$ f^{-1}(Y_i) = f^{-1} \Bigl( \bigcup_j Z_j^{(i)} \Bigr) = \bigcup_j f^{-1}(Z_j^{(i)}) $$
you get that
$$
X = f^{-1} \Bigl( \bigcup_i Y_i \Bigr) = \bigcup_i f^{-1}(Y_i) = \bigcup_i \bigcup_j f^{-1} (Z_j^{i}) $$
Now stack the project (Tag 01K4) tells us that it is enough to find some cover by open affines to check that $f$ is quasi-compact.