Quasi-compactifying schemes Let $X$ be a scheme. Does there exist an open immersion $X\rightarrow Y$ with $Y$ quasi-compact?
 A: Here are two types of counterexamples. They are all locally of finite type over a fixed field $k$. They rely on the following trivial fact: If $X$ is a subscheme of $Y$ and $Y$ is covered by $n$ open affines, then $X$ (and of course every subscheme of $X$) is covered by $n$ open subschemes which are embeddable in affine schemes, in particular separated. 


*

*Nonseparated examples:
For each set I, let $(L_i)_{i\in I}$ be a family of copies of (say) the affine $k$-line, with $l_i$:= the origin of $L_i$ and $U_i:=L_i\smallsetminus\{l_i\}$. Let $X_I$ be obtained by gluing all the $L_i$'s along the $U_i$'s. A separated open subscheme of $X_I$ cannot contain more than one of the $l_i$'s. So if $I$ is infinite, $X_I$ has no finite cover by separated opens.
The above example is not quasiseparated, but a quasiseparated variant is $X=\coprod_{n≥1}X_{\{1,...,n\}}$. 

*A separated example: just take $X=\coprod_{n≥0}\mathbb{P}^n_k$.
Indeed, if $U\subset\mathbb{P}^n_k$ is embeddable in an affine scheme (i.e. $U$ is quasiaffine, since it is quasicompact) then its complement in $\mathbb{P}^n_k$ contains a hypersurface: otherwise we would have $H^0(U,\mathscr{O}_U)=k$ or $0$. Thus, if  $\mathbb{P}^n_k$ is covered by $N$ quasiaffine opens we must have $N≥n+1$ since the intersection of $≤N$ hypersurfaces is nonempty.


EDIT prompted by @schematic_boi's comment:   


*An irreducible and separated example: This comes from Qing Liu's answer to this question. Start with the affine line $L=\mathrm{Spec}(k[t])$ over $k$. For each closed point $x\in L$, put $L_x:=\mathrm{Spec}(\mathscr{O}_{L,x})$. For each set $S$ of closed points, let $X_S$ be the scheme obtained by gluing all schemes $L_x$ ($x\in S$) at their common generic point $\eta$ (this is a scheme because $\{\eta\}$ is open in each $L_x$). As Liu observes, this is an irreducible separated scheme. Let us also observe that $\Gamma(X_S,\mathscr{O}_{X_S})=:R_S\subset k(t)$ is the ring of rational functions defined at each $x\in S$. Also, if $T\subset S$ there is a natural open immersion $X_T\hookrightarrow X_S$; in particular (for $T=\emptyset$) $\{\eta\}$ is open in $X_S$.
Now assume $S$ infinite (e.g. all closed points, for infinite $k$). Assume there is an open immersion $j:X_S\to Y$ where $Y$ is quasicompact. Taking a finite affine covering of $Y$, we see that for some infinite subset $T$ of $S$, $j(X_T)$ is contained in an affine open subset. Replacing $S$ with $T$, we may assume $Y=\mathrm{Spec}(A)$ affine. Since $\{j(\eta)\}$ is open in $Y$, there is $f\in A$ such that $j(\eta)\in D(f)\subset\{j(\eta)\}$ and therefore $f$ vanishes at each closed point of $X_S$. In other words, the image of $f$ in $R_S\subset k(t)$ vanishes at infinitely many closed points but not at $\eta$, which is absurd.

A: As noted in the answer by Manny Reyes to the mathOverflow question Can any topological space be the result of a scheme?, Hochster showed, in Theorem 16 of his Annals paper Prime ideal structure in commutative rings, that the topological spaces that arise from (separated) schemes are exactly the open subsets of spectral spaces. In the same paper, he also showed that spectral spaces are exactly the underlying topological spaces of affine schemes, and that
the topological spaces arising from schemes are exactly the locally spectral spaces.   (Hochster used the word "scheme" for what we call today "separated scheme," and "prescheme" for what we call a "scheme.")  This doesn't seem to exactly answer your question.  But it would seem to make it a lot more difficult to find a counterexample (if there is one). 
