I was looking at proofs of the following: Let $X\subseteq\mathbb{R}$. If $f:X \to \mathbb{R}$ is injective and continuous, then $f$ is strictly monotonic.
I am working with the following definition: $f$ is monotonic increasing if for all $a<b$ we have $f(a)\leq f(b)$. $f$ is strictly monotonic increasing if for all $a<b$ we have $f(a)<f(b)$. Monotonic decreasing and strictly monotonic decreasing are analogous.
Many answers, such as this one, use the following result, which is what this post is about: if $f$ is not monotone, then there exist $a<b<c$ such that $f(a)>f(b)<f(c)$ or $f(a)<f(b)>f(c)$.
The result is intuitive, but the proof that I came up with and would like some verification for is kind of obnoxious (if you don't want to check the whole thing just glance at parts of it and skip to the end):
PROOF: Since $f$ is not monotonic increasing, there exists $x,y\in X$ such that $x<y$ and $f(x)>f(y)$. Similarly, since $f$ is not monotonic decreasing, there exists $v,w\in X$ such that $v<w$ and $f(v)<f(w)$.
First, suppose $x=v$. Then $w\neq y$, otherwise $f(x)>f(y)=f(w)>f(v)=f(x)$. So since $x=v<w$ and $x<y$ we have either $x<y<w$ or $x<w<y$.
Case $x<y<w$: We know $f(x)>f(y)$. But we also have $f(w)>f(v)=f(x)>f(y)$. So we have $x<y<w$ and $f(x)>f(y)<f(w)$, which is what we're looking for.
Case $x<w<y$: We have $f(w)>f(v)=f(x)>f(y)$. So we have $x<w<y$ and $f(x)<f(w)>f(y)$, which is what we're looking for.
Now assume that $x\neq v$.
Now suppose $x=w$. In this case we'd be done since $v<w=x<y$ and $f(v)<f(w)=f(x)>f(y)$. So we may assume $x\neq w$.
Now suppose $y=v$. In this case we'd also be done since $x<y=v<w$ and $f(x)>f(y)=f(v)<f(w)$. So we may assume $y\neq v$.
Now suppose $y=w$. Then either $v<x<y$ or $x<v<y$.
Case $v<x<y$: We have $f(v)<f(w)=f(y)<f(x)$. Hence $f(v)<f(x)>f(y)$ and we're done.
Case $x<v<y$: We have $f(x)>f(y)=f(w)>f(v)$. Hence $f(x)>f(v)<f(y)$ and we're done.
Now assume $y\neq w$.
Here are our assumptions so far: $x\neq v$, $x\neq w$, $y\neq v$, $y\neq w$.
Let us consider all the ways of ordering the values $x,y,v,w$ while ensuring $x<y$ and $v<w$: \begin{gather} v<w<x < y \\ v<x<w < y\\ v<x<y < w\\ x<v<w < y\\ x<v<y < w\\ x<y<v<w \end{gather} I will go through each of the 6 cases and show that we can find $a<b<c$ such that $f(a)>f(b)<f(c)$ or $f(a)<f(b)>f(c)$.
Case 1: If $f(w)>f(x)$, then $v<w<x$ and $f(v)<f(w)>f(x)$. If $f(w)\leq f(x)$, then $v<x<y$ and $f(v)<f(w)\leq f(x)>f(y)$.
Case 2: If $f(v)<f(x)$, then $v<x<y$ and $f(v)<f(x)>f(y)$. If $f(v)\geq f(x)$, then $v<w<y$ and $f(v)<f(w)>f(x)>f(y)$.
Case 3: If $f(v)<f(x)$ then $v<x<y$ and $f(v)<f(x)>f(y)$. If $f(v)\geq f(x)$ then $v<y<w$ and $f(v) > f(y)<f(w)$.
Case 4: If $f(x)>f(v)$ then $x<v<w$ and $f(x)>f(v)<f(w)$. If $f(x)\leq f(v)$ then $v<w<y$ and $f(v)<f(w)>f(y)$.
Case 5: If $f(x)>f(v)$ then $x<v<w$ and $f(x)>f(v)<f(w)$. If $f(x)\leq f(v)$ then $x<y<w$ and $f(x)>f(y)<f(w)$.
Case 6: If $f(y)<f(v)$ then $x<y<v$ and $f(x)>f(y)<f(v)$. If $f(y)\geq f(v)$ then $x<v<w$ and $f(x)>f(v)<f(w)$.
END OF PROOF.
I would like to know if there is a more elegant way of proving this from the definitions that does not devolve into tedious case by case analysis.