[example: Interval and Ray in the Real Line]
In $\mathbb{R}$ with its usual metric, the interval $(0,1)$ is bounded. If $x\in(0,1)$, then $0<x<1$, so
\begin{align*}
|x-0|=x<1<2.
\end{align*}
Thus every $x\in(0,1)$ lies in $B(0,2)$, and hence
\begin{align*}
(0,1)\subset B(0,2).
\end{align*}
By contrast, the ray $[0,\infty)$ is unbounded. To see this, let $x_0\in\mathbb{R}$ and $R>0$ be arbitrary, and set
\begin{align*}
y=|x_0|+R+1.
\end{align*}
Then $y\ge 0$, so $y\in[0,\infty)$. If $x_0\ge 0$, then $|x_0|=x_0$, and
\begin{align*}
|y-x_0|=|x_0+R+1-x_0|=R+1>R.
\end{align*}
If $x_0<0$, then $|x_0|=-x_0$, and
\begin{align*}
|y-x_0|=|-x_0+R+1-x_0|=R+1-2x_0>R.
\end{align*}
In either case, $y\notin B(x_0,R)$. Therefore no ball in $\mathbb{R}$ contains all of $[0,\infty)$, so the ray is unbounded. This example separates finite extent from the presence of endpoints.
[/example]