$\newcommand{\R}{\mathbb{R}}$ Problem: Let $X$ be a totally ordered set and $Y \subsetneq X$ convex in $X$. Does it follow that $Y$ is either a ray or interval in $X$?
Here's my attempt at a counterxample. Because I'm self studying I want to make sure I'm not ingraining any bad habits or mistakes in my attempts at the exercises, so bear with me on what is I'm sure a simple question.
Attempt: Let $X = \R \times \R$ under lexicographic order in the order topology, and let $Y = \R \times \{1\}$. Notice that $Y$ is neither a ray or interval in $\R$, it is the collection $\{(a,1) \mid a \in \R\}$ and hence is neither of the form $\{x \times y \mid a \times b < x\times y< c\times d\}$ for some $a\times b,c\times d \in \R\times \R$ or $\{x\times y \mid a \times 1 < x \times y\}$ or $\{x\times y \mid a\times 1 >x\times y\}$. But $Y$ is convex. Indeed for any $(a,1)<(b,1) \in Y$ the interval $(a \times 1, b \times 1)$ of $X$ consists of all tuples $(c,1)$ for which $a<c<b$ which is certainly contained in $Y$.
I had seen some other discussions and figured that since my proof wasn't one of the standard ones there I might be making a mistake somewhere. Granted I found the lexicographic order difficult to work with, so that might be the issue. Thanks in advance for the clarification.
$\newcommand{\R}{\mathbb{R}}$ As hinted at by user $0$XLR, the counterexample can be changed by letting $Y = \{1\} \times \R$ and this will work as intended. This subset is clearly neither a ray or interval in $\R$ , but this set is in fact convex unlike my first example. For any $(1,a) < (1,b)$ in $Y$, the interval $(1 \times a, 1\times b)$ of $\R$ consists of all the tuples $1 \times c$ where $a<c<b$, because the first coordinate agrees and we are in the lexicographic order topology. These points $1 \times c$ are now certainly contained in $Y$, and we have a convex subset of $Y$ which is neither a ray or interval as desired.