I am trying ot figure out a proof of the following fact, that I believe is true, but it seems to me that something is lacking. Suppose we have commutative, unitary rings $A,B$ and a (unit preserving) homomorphism $\varphi \colon A \rightarrow B$ which makes $B$ an $A$-algebra. Suppose also we have elements $f_1,\dots,f_n \in B$ which generate the unit ideal and such that $B_{f_i}$, namely the localisation of $B$ with respect to $f_i$, is a finitely generated $A$-algebra. Show that then $B$ is a finitely generated $A$-algebra. Could someone give me a rigorous proof of this fact (or a counterexample, if this is false)? Thank you!