Every interval listed above has the stated property. Conversely, let
\(I\subseteq\R\) have this property. If
\(I=\emptyset\text{,}\) then
\(I=(0,0)\text{;}\) if
\(I=\{a\}\text{,}\) then
\(I=[a,a]\text{.}\) Thus, we may assume that
\(I\) is nondegenerate.
First suppose that
\(I\) is bounded below but not above. Let
\(a=\inf I\text{.}\) If
\(z>a\text{,}\) then
\(z\) is not a lower bound of
\(I\text{,}\) so there is
\(x\in I\) with
\(x<z\text{.}\) Since
\(I\) is not bounded above, there is also
\(y\in I\) with
\(z<y\text{.}\) Since
\(x<z<y\text{,}\) the assumed property gives
\(z\in I\text{.}\) Thus
\((a,\infty)\subseteq I\text{.}\) On the other hand, no element of
\(I\) can be less than
\(a\text{.}\) Hence
\(I=(a,\infty)\) or
\(I=[a,\infty)\text{,}\) according as
\(a\notin I\) or
\(a\in I\text{.}\)
The case in which
\(I\) is bounded above but not below is similar: if
\(b=\sup I\text{,}\) then
\(I=(-\infty,b)\) or
\(I=(-\infty,b]\text{,}\) according as
\(b\notin I\) or
\(b\in I\text{.}\)
If
\(I\) is neither bounded below nor bounded above, then for every
\(z\in\R\) we can choose
\(x,y\in I\) with
\(x<z<y\text{.}\) The assumed property gives
\(z\in I\text{,}\) so
\(I=\R\text{.}\)
Finally, suppose that
\(I\) is bounded both below and above. Let
\(a=\inf I\) and
\(b=\sup I\text{.}\) Since
\(I\) is nondegenerate, we have
\(a<b\text{.}\) If
\(a<z<b\text{,}\) then
\(z\) is neither a lower bound nor an upper bound of
\(I\text{.}\) Thus, there exist
\(x,y\in I\) with
\(x<z<y\text{,}\) and hence
\(z\in I\text{.}\) Therefore
\((a,b)\subseteq I\text{.}\) Also, every element of
\(I\) lies in
\([a,b]\text{.}\) Consequently,
\(I\) is one of
\((a,b)\text{,}\) \([a,b]\text{,}\) \((a,b]\text{,}\) or
\([a,b)\text{,}\) according to whether
\(a\) and
\(b\) belong to
\(I\text{.}\)