a rate function
A rate function is the object inside the exponent of a large deviation principle: the map I: X -> [0, infinity] that assigns to each outcome x the exponential cost of observing it as a rare deviation. Where I(x) = 0 the outcome is typical (this is where the law of large numbers concentrates), and the larger I(x) is, the more exponentially suppressed that outcome becomes. The rate function is the single function that encodes every large-deviation probability in the theory, because the probability of a set is governed by its cheapest point.
Technically, a rate function is required to be lower semicontinuous, equivalently to have closed sublevel sets {x : I(x) <= c} for every c. Lower semicontinuity is exactly the condition that makes the upper and lower bounds consistent: it guarantees that infima over closed sets are attained or at least approached cleanly, so that the closed-set upper bound and open-set lower bound match on sets whose interior and closure agree (so-called I-continuity sets). A rate function is generally non-negative and need not be finite everywhere; I(x) = +infinity flags an outcome so rare it is suppressed faster than any exponential e^(-c n).
Rate functions are unique: a given LDP determines its rate function. They tend to be convex when the LDP comes from sums of independent objects (Cramer, Gartner-Ellis give convex I as a Legendre transform), but convexity is not part of the definition — Sanov's rate function on measure space (relative entropy) is convex, while rate functions arising through the contraction principle from a nonlinear map can be non-convex with several local minima, which is precisely what makes metastability and phase coexistence visible.
For the empirical mean of n iid N(0,1) variables, the rate function is I(x) = x^2/2. It vanishes at x = 0 (the typical value) and grows quadratically, so P(mean near x) decays like e^(-n x^2/2) — a clean parabola whose curvature 1 matches the inverse variance.
I vanishes at the typical value and rises as outcomes get rarer.
Lower semicontinuity, not continuity, is the requirement. Do not assume I is convex: convexity is a feature of Cramer/Gartner-Ellis rate functions, not a definitional property, and non-convex rate functions are physically important.