If you look at the context of $T$ a continuous map from a topological space $X$ to itself and $f$ a continuous function from $X$ to $\mathbb R$, the natural analagous version of the question is looking for invariant ($\sigma$-additive) probability measures on $X$ maximizing or minimizing $\int f\,d\mu$.
This area of study has received some attention and is called ergodic optimization. See here for a survey. A central conjecture in this area concerns the case $X=\{0,1\}^{\mathbb Z^+}$$X=\lbrace 0,1\rbrace ^{\mathbb Z^+}$; $T$ is the shift map on $X$ and $f$ a Lipschitz function. It is conjectured that for a residual set of Lipschitz functions, the maximizing measure is supported on a periodic orbit.