  We consider the following generalisation of a well-known problem in
Riemannian geometry: When is a smooth real-valued function s on a given compact
n-dimensional manifold M (with or without boundary) the scalar curvature of
some smooth pseudo-Riemannian metric of index q on M? We prove that this is the
case for every s if 2<q<n-2, provided M admits a metric of index q at all. In
fact, if 2<q<n-2, then each connected component of the space of
pseudo-Riemannian metrics of index q on M contains a metric with scalar
curvature s. We prove several theorems for pseudo-Riemannian metrics of index 1
or 2 as well.
