This is exercise 5.1.H in Vakil's note 'FOAG':
Show that a scheme $X$ is quasi-compact and quasi-separated iff $X$ can be covered by a finite number of affine open subsets, any two of which have intersection also covered by a finite number of affine open subsets.
My idea is as follows:
If $X$ is quasi-compact and quasi-separated, then $X$ can be covered by a finite number of affine open subsets, any two of which have intersection also covered by a finite number of affine open subsets by the previous exercise 5.1.F:
A scheme is quasi-separated iff the intersection of any two affine open subsets is a finite union of affine open subsets.
This is easy and I have solved it. My question is below:
Conversely, we set the scheme $X$ can be covered by a finite number of affine open subsets, any two of which have intersection also covered by a finite number of affine open subsets. Let $X=\bigcup_{i=1}^nU_i$ where $U_i$ are affine open subsets such that any two of which have intersection also covered by a finite number of affine open subsets. So $X$ is obviouly quasi-compact. We just need to prove that the intersection of any two affine open subsets is a finite union of affine open subsets by the previous exercise 5.1.F as above.
(*) Take any affine open subset $Y$ and if we can prove that $Y\cap U_i$ can be written as a finite union of affine open subsets, then the question is finished:
Take $A,B$ are two affine open subsets of $X$,then $A\cap B=\bigcup_{i=1}^n((A\cap U_i)\cap(B\cap U_i))$. Use (*) we know that $A\cap U_i=\bigcup_{\alpha}C_{\alpha},B\cap U_i=\bigcup_{\beta}D_{\beta}$ where $\alpha,\beta$ are finite and $C_i,D_i$ are affine open subsets. Then we find that $$(A\cap U_i)\cap(B\cap U_i)=\left(\bigcup_{\alpha}C_{\alpha}\right)\cap\left(\bigcup_{\beta}D_{\beta}\right)\subset U_i.$$ Since $U_i$ is affine, then it is quasi-separated, then $$\left(\bigcup_{\alpha}C_{\alpha}\right)\cap\left(\bigcup_{\beta}D_{\beta}\right)=\bigcup_{\alpha,\beta}(C_{\alpha}\cap D_{\beta})$$ is a finite union of affine open subsets, then so is $A\cap B$.
So the question is: how to prove (*)? or how to prove the exercise without using this?