A morphism $f: V \rightarrow X$ of schemes is a locally closed immersion if it can be factored into a closed immersion followed by an open immersion. It is not hard to show that if $f$ is an open immersion followed by a closed immersion, then it is a locally closed immersion, but the converse is at the very least not clear (to me). For a number of reasons, this choice as the definition of locally closed immersion (rather than the opposite) is the right one (e.g. it is then not hard to see that compositions of locally closed immersions are locally closed immersions). 



> 
> Is there some $f: V \rightarrow X$ that can be factored into a closed immersion followed by an open immersion, that cannot be factored into an open immersion followed by a closed immersion?
> 
> 
> 


*Warning:* it isn't too hard to show that there is no example with $V$ reduced or with $f$ quasicompact, so any example has to be a little strange-looking. *Back-story:* I've been confronted with this question when learning algebraic geometry with a class (conventionally known as "teaching"); it seems a natural question. And any counterexample would likely be a handy example to have for other reasons as well: a very limited stock of counterexamples tends to refine my intuition, and to warn me what can go wrong.



A closed subscheme of an open subscheme that is not an open subscheme of a closed subscheme?
Hi Ravi,


There is an example in [Tag 01QW](http://math.columbia.edu/algebraic_geometry/stacks-git/locate.php?tag=01QW) in Johan's stacks project. 


Jarod


