Order topology continuous functions I have the following HW problem:
Let $$Y$$ be an ordered set in the ordered topology. Let $$f, g: X \to Y$$ be continuous. Show that the set $$\{x|f(x) \leq g(x) \}$$ is closed in $X.$
My proof:
We show that the complement $\{x|f(x) > g(x) \}$ is open. Observe that $\{f(x)|f(x) > g(x) \}$ is open because it is an open ray. So the inverse image $f^{-1}(\{f(x)|f(x) > g(x) \}) = \{x|f(x) > g(x) \}$ will be open because $f$ is continuous.
But what strikes me about this proof is that I only needed to use the continuity of $f.$ If I had only the continuity of $g$ then I also could have made the proof work. So is all that is needed the continuity of one of the functions? I played around with a few examples in $\mathbb{R}$ and it looks like that is the case, but I am not sure.
 A: Here’s a counterexample if $g$ is not continuous. Let $X=Y=\Bbb R$, let $f(x)=0$ for all $x\in\Bbb R$, and let
$$g(x)=\begin{cases}
-1,&\text{if }x\le 0\\
1,&\text{if }x>0\,.
\end{cases}$$
Then $\{x\in\Bbb R:f(x)\le g(x)\}=\{x\in\Bbb R:0\le g(x)\}=(0,\to)$, which is not closed.
Your argument goes astray at the beginning, because it’s not necessarily true that $\{f(x):f(x)>g(x)\}$ is open. Suppose that $X=Y=\Bbb R$, $f(x)=0$ for all $x\in\Bbb R$, and $g(x)=x$ for all $x\in\Bbb R$; then
$$\{f(x):f(x)>g(x)\}=\{0\}\,,$$
which is not open.
However, the idea of showing that $U=\{x\in X:f(x)>g(x)\}$ is open is a good one. Let $x_0\in U$, $a=g(x_0)$, $b=f(x_0)$. Suppose first that there is some $c\in(a,b)$. Let $V_a=(\leftarrow,c)$ and $V_b=(c,\to)$; $V_a$ is an open nbhd of $a$ in $Y$, and $V_b$ is an open nbhd of $b$. Let $W_a=g^{-1}[V_a]$ and $W_b=f^{-1}[V_b]$; $f$ and $g$ are continuous, so $W_a$ and $W_b$ are open nbhds of $x_0$ in $X$. Let $W=W_a\cap W_b$; $W$ is an open nbhd of $x_0$, and for each $x\in W$ we have $f(x)>c>g(x)$, so $W\subseteq U$.
If there is no such $c$, then $b$ is the immediate successor of $a$ in $Y$. In that case let $V_a=(\leftarrow,b)=(\leftarrow,a]$ and $V_b=(a,\to)=[b,\to)$ and proceed to define $W_a,W_b$, and $W$ as before. If $x\in W$, then $f(x)\in V_b$, so $f(x)>a$, while $g(x)\in V_a$, so $g(x)\le a$, and therefore $f(x)>g(x)$, i.e., $x\in U$. Thus, in this case we also find that $x_0\in W\subseteq U$. In short, every point of $U$ has an open nbhd contained in $U$, so $U$ is open, as desired.
