In his probability book Bauer proves the following version of Jensen's inequality:
Proposition. Let $X$ be an integrable random variable taking values in an open interval $I\subset\mathbb{R}$, and let $q$ be a convex function on $I$. If $q\circ X$ is integrable, then
$$q(E(X))\leq E(q\circ X).$$
Now am asked to prove that the result holds for an arbitrary interval, e.g. $I=[a,b]$. As a hint Bauer suggests to show that $q$ is lower semicontinuous on $I$, i.e. that $\{x\in I:q(x)>\alpha\}$ is relatively open in $I$ for every $\alpha \in \mathbb{R}$.
How can I do this? I tried an answer below. Any comment is greatly appreciated.
EDIT: I believe Bauer means to show that $q$ is upper semicontinuous, not lower. Indeed by considering the indicator of $\{0,1\}$ on the interval $[0,1]$ it is clear that a convex function need not be lower semicontinuous. To show this, suppose $I=[a,b]$. By convexity we know that $q$ is continuous on $(a,b)$, and so in particular upper semicontinuous on $(a,b)$. Also by convexity, we know that $q'_+(a)$ exists, but might be $-\infty$ (convexity implies that $q'_+(x)$ exists and is nondecreasing on $I$, and is real-valued on $I^\mathrm{o}$). If $q'_+(a)\in\mathbb{R}$, then $q$ is continuous at $a$ and so in particular upper semicontinuous at $a$. If $q'_+(a)=-\infty$, then we see that that $q$ must be decreasing in a neighborhood of $a$, which implies upper semicontinuity of $q$ at $a$. A similar argument using the left derivative $q'_-(x)$ applies for the endpoint $b$.
Suppose $I=[a,b]$. If $E(X)=a$ or $E(X)=b$, then $X=a$ almost surely or $X=b$ almost surely, and in this case we see that Jensen's inequality is in fact an equality. Hence we may suppose $E(X)\in I^\mathrm{o}$. As noted, we have the inequality
$$ q(y)\geq q(x) + q'_+(x)(y-x) \hspace{0.5cm} x\in I^\mathrm{o}, y\in I $$
and so
$$ q(X)\geq q(x) + q'_+(x)(X-x) \hspace{0.5cm} x\in I^\mathrm{o} .$$
Taking expectations on both sides yields
$$ E(q(X))\geq q(x) + q'_+(x)(E(X)-x) \hspace{0.5cm} x\in I^\mathrm{o} .$$
In particular, for $x=E(X)$ we get
$$ E(q(X))\geq q(E(X)) $$
which is Jensen.
The upper semicontinuity part is to ensure that the function $q:I\to \mathbb{R}$ is Borel measurable, so that the composite function $q\circ X$ is measurable if $X$ is a random variable taking values in $I$.