More upper/lower semi-continuous functions in (algebraic) geometry? The notion of upper/lower semi-continuity is sometimes encountered in algebraic geometry.
Here by upper semi-continuity one means a function on a topological space $f:X\rightarrow S$ with value in some ordered topological space (like the field of real numbers), such that $\lim\sup_{x\rightarrow y}f(x)\leq f(y)$. Intuitively, for points $x$ that are close to a given point $y$, may the value $f(x)$ "exceeds" $f(y)$, the difference should be "small" and "vanishes" as $x$ approaches $y$. And lower semi-continuity means the opposite, namely replace "$\leq$" by "$\geq$".
Among the typical examples one thinks of the dimension function: let $k$ be a base field, and $X$ be a locally finite type $k$-scheme. The function $$x\in X \mapsto \dim_xX$$ is upper semi-continuous, where by $\dim_xX$ is understood to be the combinatory dimension of $X$ at $x$, namely the length of chains of inclusions of irreducible closed subschemes $$x\in X_1\subsetneq X_2\subsetneq \cdots\subsetneq X_d=X$$
There seems to be a lot of examples of such upper/lower semi-continuous functions in geometry counting certain "discrete invariants", especially those related to stratifications of spaces. It'll be great to have the list extended in mathoverflow.
I hope this question is well-posed...
 A: The most basic semi-continuous function in algebraic geometry is, I think, the following: given a coherent sheaf $F$ on a scheme $X$ of (locally) finite type over $k$, the function
$$ x \mapsto \dim_{k(x)} F\mid_x = \dim_{k(x)} F \otimes k(x) $$
is upper semi-continuous. It follows from Nakayama's Lemma.
A: There are a lot of examples in the representation theory of finite-dimensional algebras.
For instance, we can encode associative finite-dimensional algebras of given dimension $d$ into an algebraic variety and the map sending an algebra to its projective dimension is upper semicontinuous. Or for a fixed algebra, one can encode its modules or pairs of modules of given dimensions into an algebraic variety and functions like the dimension of the $i$th Ext group is upper semicontinuous.
It might be kind of weird because these varieties don't parametrize isomorphism classes, but rather ways of putting a module or algebra structure on a fixed vector space, but these results tend to be useful in geometric approaches to finite-dimensional algebras.
A: Seshadri constants (see Thomas Bauer et al, A primer on Seshadri constants, Contemporary Mathematics 496 (2009) 33-70, arXiv:0810.0728) are lower semicontinuous.
This fact is of course related to J.C. Ottem's example, but (a priori) it is not "the same". I believe that there is not a single coherent F giving the same stratification that the Seshadri constant gives (you could get it by a sequence of coherent F, or using non-coherent F, trivially.)
A: The semicontinuity theorem (Hartshorne III.11) states that the ranks of cohomology groups  on the fibers of a morphism is a semicontinuous function. More precisely, given a projective morphism $f:X\to Y$ of noetherian schemes and a coherent sheaf $F$ on $X$, flat over Y, then the function 
$$
h^i(y,F)=\dim_{k(y)}H^i(X_y,F_y)
$$is upper semicontinuous as a function of $y$. Here $X_y$ denotes the fibre of $f$ over $y$. This is used widely in algebraic geometry. 
A: Hodge numbers are (upper) semi-continuous in a family of complex manifolds and constant for Kähler manifolds. Then again, this is a special case of the above, at least for projective families.
See this MO answer for links and references for related stuff.
A: There is a paper Variation der globalen Ext in Deformationen kompakter komplexer Räume dealing with (upper) semi-continuous for relative Ext sheaves.
[Satz 3] Let $f:X\rightarrow Y$ be a proper flat morphism of complex varieties and $\mathcal{F},\mathcal{G}$ be coherent $\mathcal{O}_X$-modules flat over $Y$. Then

*

*$\{y\in Y\,|\,\dim Ext^q_{\mathcal{O}_{X_y}}(\mathcal{F}|_{X_y},\mathcal{G}|_{X_y})\leq n\}$ is Zariski open for any $q$ and $n$


*Assume more that the base $Y$ is smooth, then the function $y\mapsto Ext^q_{\mathcal{O}_{X_y}}(\mathcal{F}|_{X_y},\mathcal{G}|_{X_y})$ is constant implies that the sheaf $f_*\mathcal{E}xt^q(\mathcal{F},\mathcal{G})$ is locally free
