Finite covering by finitely generated B-algebras While I was working on the first properties of schemes on Hartshorne's Books, I needed the following result that I couldn't prove it:
Let $X=Spec(A)$ be an affine scheme. Suppose that there exist an open an finite cover $V_1 \cup V_2 \cup .... \cup V_n = X$. Suppose that $V_i \cong Spec(A_i)$ for some ring $A_i$ that is a finitely generated $B$-algebra (for some fixed $B$ to all $i$) Then $A$ is a finitely generated $B$-algebra. 
 A: I'll assume what Pavel Čoupek indicated in his comment to the question. The desired statement then essentially follows from the following lemma (this is Lemma 3.32 from the book Algebraic Geometry 1 by Görtz and Wedhorn where you will also find a more complete proof on p. 79):

Let $B$ be a ring and let $A$ be a $B$-algebra. Assume that there are finitely many elements $f_1,\dotsc,f_n \in A$ such that the localization $A_{f_i}$ is a finitely generated $B$-algebra for all $i$ and such that the ideal generated by $\lbrace f_1,\dotsc,f_n \rbrace$ is the whole ring $A$. Then $A$ itself is a finitely generated $B$-algebra.

Sketch of proof: For each $i$, fix finitely many generators $a_{ij}$ of $A_{f_i}$ as a $B$-algebra. All in all, there are only finitely many $a_{ij}$, whence we can write $a_{ij} = c_{ij} / f_i^m$ (with $c_{ij} \in A$) for some $m$ independent of $i$ and $j$. In addition, write $\sum g_i f_i = 1$ with suitable $g_i \in A$ (which exist since the ideal generated by the $f_i$ is $A$). Now it can be shown that $A$ is generated as a $B$-algebra by all the $c_{ij}$, $f_i$ and $g_i$.
In order to apply this lemma, note that one can cover each $V_i$ by open subsets which are simultaneously standard open in both $V_i = \operatorname{Spec} A_i$ and $X = \operatorname{Spec} A$ (i.e. isomorphic to both $\operatorname{Spec} A_f$ and $\operatorname{Spec} \, (A_i)_{g}$ for suitable $f \in A$ and $g \in A_i$) [Stacks Project, Lemma 25.11.5]. But with $A_i$ being a finitely generated $B$-algebra, any $(A_i)_g$ is a finitely generated $B$-algebra as well. Thus, one can cover the affine scheme $X = \operatorname{Spec} A$ by open subsets of the form $\operatorname{Spec} A_f$ such that $A_f$ is a finitely generated $B$-algebra. Finally, as any affine scheme is quasi-compact, $X$ is already covered by finitely many of such sets.
