Definition: Let $X$ be a random variable and $C(X)$ a condition that depends on $X$. The condition is said to hold almost everywhere if $\Pr\lbrace C(X)\rbrace = 1$.

For example, consider $f(x) = \abs{x}$, which is differentiable everywhere except $x=0$. If the distribution of $X$ is continuous, $f$ would be differentiable almost everywhere, because $\Pr(X=0) = 0$. However, if $X$ has a discrete distribution with positive mass at 0, $f$ would not be differentiable almost everywhere. The “almost everywhere” claim depends on both the condition and the probability space.