the occupation-time formula
The occupation-time formula is the change-of-variables identity that makes local time useful: it lets you compute a time-integral of any function of the Brownian path as a SPACE-integral against local time. Instead of integrating along the (rough, unparametrised) trajectory, you integrate over levels, weighting each level a by how much local time L_t^a the path has accumulated there.
The statement: for every bounded (or nonnegative) measurable function f, almost surely, integral over [0,t] of f(B_s) ds = integral over R of f(a) L_t^a da. The left side adds up f(B_s) along the clock; the right side rearranges the same total by sorting the path's time according to which level it was at, with the local time L_t^a serving as the density (Radon-Nikodym derivative) of the occupation measure mu_t(A) = Leb{ s <= t : B_s in A } with respect to Lebesgue measure da. In one line, mu_t(da) = L_t^a da. The formula generalises verbatim to any continuous semimartingale X with a continuous local time L_t^a(X), where da is replaced by the quadratic-variation differential: integral over [0,t] of f(X_s) d<X>_s = integral over R of f(a) L_t^a(X) da. (For Brownian motion d<B>_s = ds, recovering the clean version.)
Why it matters: this is the workhorse behind Tanaka's formula and the Ito-Tanaka generalisation of Ito's formula to convex (non-C^2) functions, behind explicit computations of additive functionals such as integral f(B_s) ds, and behind the very EXISTENCE of a jointly continuous local time (the formula plus smoothness of the occupation measure is one route to it). The honest content: the occupation measure of Brownian motion is absolutely continuous with respect to Lebesgue measure — that is a theorem, not a triviality, and it is exactly why a density (local time) exists. For a process whose occupation measure is singular (no density), there is no local time and the formula breaks; the d<X>_s factor cannot be dropped for a general semimartingale.
To find the time Brownian motion spends in [0, 1] up to time t, take f = indicator of [0,1]: integral over [0,t] of 1{0 <= B_s <= 1} ds = integral from 0 to 1 of L_t^a da. The occupation of a band is just the total local time across that band.
Trade a time-integral along the path for a level-integral against local time: mu_t(da) = L_t^a da.
The formula presupposes the occupation measure has a density (local time exists) — true for Brownian motion but false for processes with singular occupation; for a general semimartingale the d<X>_s factor is mandatory.