# some questions about open affine cover

Suppose $$X$$ and $$Y$$ are separated noetherian schemes. Let $$f: X\to Y$$ be a morphism between them. If $$\mathcal{U}=(U_{i})$$ is an open affine cover of $$X$$ and $$V$$ is any open affine subset of $$Y$$, Hartshorne's III proposition 8.7 claims that $$U_{i}\cap f^{-1}(V)$$ are still open affine subsets of $$X$$.

Hartshorne gives a hint II Ex 4.3, but $$f^{-1}(V)$$ may not be an open affine subset of $$X$$. And I don't know how to use $$V$$ is an open affine subset of $$Y$$... And I don't know whether $$f$$ is separated and I can't use properties of fibre product... Maybe I misunderstand this problem...

Could you help me and give me an explanation?

$$\require{AMScd}$$First, if $$S$$ is a scheme, and $$W, W' \subset S$$ are open, then $$W \cap W' = W \times_S W'$$.
We may also write $$f^{-1}(V) = X \times_Y V$$, so that $$U \cap f^{-1}(V) = U \times_X (X \times_Y V) \cong (U \times_X X) \times_Y V = U \times_Y V.$$
$$\begin{CD} U \times_Y V @>>> V\\ @VVV @VVV\\ U @>>> Y \end{CD}$$
Now, since $$Y$$ is separated, the morphism $$V \to Y$$ is an affine morphism by the mentioned exercise. Hence, as the base change of such a morphism, $$U \times_Y V \to U$$ is also affine, which implies that $$U \times_Y V$$ is an affine scheme.