Solution (source code)

= Solution
{c}

Assume condition (1). For fixed $a$, the <supremum>
$$
M_a(r)=\sup_{x\in B(a,r)}f(x)
$$
is nondecreasing as $r$ increases. Therefore its limit as $r\downarrow0$ exists in the extended <real numbers> and equals $\inf_{r>0}M_a(r)$. Because $a\in B(a,r)$, it is at least $f(a)$. Condition (1) says precisely that this limit is $f(a)$.

It follows that for every $\varepsilon>0$ there is $r>0$ with $M_a(r)<f(a)+\varepsilon$. Fix $C\in\mathbb R$ and $a$ with $f(a)<C$. Taking $\varepsilon=C-f(a)$ produces an <open ball> on which $f(x)<C$. Thus $\{x:f(x)<C\}$ is an <open set>, and its <complement>
$$
\boxed{\{x:f(x)\geq C\}\text{ is a closed set}.}
$$
This proves (1) implies (2). The property being characterized is <upper semicontinuity>.