  We introduce a quite large class of functions (including the exponential
function and the power functions with exponent greater than one), and show that
for any element $f$ of this function class, a self-adjoint element $a$ of a
$C^*$-algebra is central if and only if $a \leq b$ implies $f(a) \leq f(b).$
That is, we characterize centrality by local monotonicity of certain functions
on $C^*$-algebras. Numerous former results (including works of Ogasawara,
Pedersen, Wu, and Moln\'ar) are apparent consequences of our result.
