When is the indicator of a sublevel set integrable? I have a smooth manifold (even embedded, if you wish) and a smooth real valued function $f:M\rightarrow \mathbb R$.
I am interested to know when are the indicators of sublevel sets of $f$ integrable (in the sense of the usual Riemann integral on manifolds, not something involving Lebesgue integration or something else).
By sublevel sets, I mean sets of the form $f^{-1}((-\infty,x])$ for $x\in \mathbb R$. $f$ can even be bounded if you want, so you can just look at $f^{-1}((-M,x])$ for some large $M>0$.
I understand that if $f$ is only continuous, then these indicators are not necessarily integrable, even when $M$ is just a ball in $\mathbb R^n$. For instance, if $f$ is very wild, then some sublevel sets of $f$ can have wild boundary which is not of measure $0$ (we can construct such an $f$ by using the Urysohn lemma or something). Then, the appropriate indicator will be discontinuous on a set of positive measure, and thus not Riemann integrable.
The question is - if I assume that $f$ is smooth, and even has uniformly bounded derivatives if you wish - can this still happen? In such a case, how 'bad' can the sublevel sets be? Is there another natural condition one can impose to ensure this?
Remark - While I don't mind assuming that $f$ is smooth and with bounded derivatives, I prefer not to assume that it is Morse, if possible.
Thanks in advance.
 A: Indicator functions of arbitrary sublevel sets of smooth functions need not be Riemann-integrable. Here's a counterexample.
Let $K\subseteq M$ be any closed set whose boundary has positive measure (such as a fat Cantor set). Theorem 2.29 in my Introduction to Smooth Manifolds shows that there is a smooth nonnegative function $f\colon M\to \mathbb R$ such that $f^{-1}(0) = K$. It follows that $f^{-1}((-\infty,0])=K$, and its indicator function is not Riemann-integrable. If $M$ is compact, then $f$ certainly is bounded along with its derivatives of all orders (with respect to any Riemannian metric on $M$). For a noncompact example, start with a compact $M$ as above and remove a point of $M\smallsetminus K$.
Of course, if $c$ is a regular value of $f$, then $f^{-1}((-\infty,c])$ is a regular domain (i.e., closed embedded codimension-$0$ submanifold with boundary), so the indicator function in that case will always be Riemann-integrable. By Sard's theorem, almost every $c\in\mathbb R$ is a regular value.
