Assume that $ f : X \to Y $ is a morphism of schemes. Under what situations can we find some non empty open affine subscheme $ {\rm Spec} B \subseteq Y$ such that $ f^{-1}({\rm Spec}B)$ is affine? Here is what I have already thought about:


* If $ f $ is an affine morphism, we just take any open affine subscheme of $Y$.
* Let $X$ be the affine line with two origins. If we think about the morphism $ X \to \mathbb{A}^1$, then there is no affine neighborhood of the origin in $ \mathbb{A}^1$ whose preimage is affine. However, the preimage of $ \mathbb{A}^1 \backslash \{ 0 \} $ is affine.
* We can't find such a $ {\rm Spec} B $ for the morphism $ \mathbb{P}^1\_k \to {\rm Spec} k $.



Shrinking the target to make the domain affine
I don't know whether this is usefull: a necessary and sufficient condition, when $f$ is of **finite presentation**, is that $X\times\_Y \mathrm{Spec}(O\_{Y,y})$ is affine for some $y\in Y$. 


Indeed, the condition is clearly necessary. Conversely, standard arguments show that $X\times\_Y \mathrm{Spec}(O\_{Y,y})$ extends to an affine morphism of finite presentation $U\to V$ for some affine open neighborhood $V$ of $y$. As $U\to V$ and $X\times\_Y V\to V$ coincide over $\mathrm{Spec}(O\_{Y,y})$ and they are finite presented over $V$, they coincide over some open neighborhood $V'=\mathrm{Spec}(B)\subset V$ of $y$. This implies that $f^{-1}(\mathrm{Spec}(B))=X\times\_Y V'$ is affine.


