TITLE: Let $Y$ be an ordered set in the order topology with $f,g:X\rightarrow Y$ continuous, show that $\{x:f(x)\leq g(x)\}$ is closed in $X$
QUESTION [12 upvotes]: Let $Y$ be an ordered set in the order topology with $f,g:X\rightarrow Y$ continuous.  Show that the set $A = \{x:f(x)\leq g(x)\}$ is closed in $X$.
I am completely stumped on this problem.  As far as I can tell I've either got the task of proving $A$ gathers its limit points, or showing that there is a closed set $V \subset Y$ such that $f^{-1}(V)$ or $g^{-1}(V)$ is equal to A, which would prove $A$ closed since both $f$ and $g$ are continuous.
The latter strategy seems like the more likely to succeed.  Unfortunately I can't find any way of constructing this set $V$.  The fact that I don't know if $f$ or $g$ are injective means I keep running into the problem of having $f^{-1}(V)$ or $g^{-1}(V)$ give me extra points not in $A$.  And even if I were able to construct $V$ this wouldn't guarantee it was closed. 
I suspect I may need to use the continuity of both $f$ and $g$ together in some way but I can't see how.  Can anyone give me some guidance on this problem? Thanks.

REPLY [3 votes]: I feel like this question could be quite difficult for a lot of beginners, so, I will post a perhaps more detailed answer than the ones I see here. 
If you only wanted hints for this problem, look no further
Otherwise, here we go:
Proof: If we let $M = \{x \in X: f(x) \leq g(x)\}$, then it suffices to show that $X - M$ is open. If $X-M$ is empty, then we are done, so suppose not. Let $x \in X-M$. Then, it must be the case that $f(x) > g(x)$. We will now show the existence of a neighborhoods $U_x$ and $V_x$ about $f(x)$ and $g(x)$, respectively, that are not only disjoint but also satisfy the property that every element in $U_x$ is larger than every element of $V_x$. 
Case 1:
$Y$ contains no smallest or largest element 
In this case, we note that there must be $a < g(x)$ and $b> f(x)$. If there is no $y \in Y$ satisfying $g(x) < y < f(x)$, then $V_x = (a, f(x))$ and $U_x = (g(x), b)$ are open sets in $Y$ satisfying the properties outlined above. If there is such $y \in Y$, then we can simply let $U_x = (y, b)$ and $V_x = (a, y)$. 
Case 2: $Y$ contains a smallest element but not a largest element 
We will note that this case will also cover, via a similar argument, the case where $Y$ contains a largest but not a smallest element. If $g(x)$ is not the smallest element, then there is a smallest element $a_0$ in $Y$ with $a_0 < g(x)$. Since $Y$ has no largest element, then there is $b > f(x)$. If there is no $y \in Y$ satisfying $g(x) < y < f(x)$, then we simply let $V_x = [a_0, f(x))$ and $U_x = (g(x), b)$. If there is such $y$, then let $U_x = (y,b)$ and $V_x = [a, y)$. Now, if $g(x)$ is the smallest element of $Y$, then if there is no $y$ with $g(x) < y < f(x)$, let $V_x = [g(x), f(x))$ and let $U_x = (g(x), b)$. If there is such $y$, then we simply let $V_x = [g(x), y)$ and $U_x = (y, b)$. 
Case 3: $Y$ contains a largest and smallest element 
If neither $g(x)$ nor $f(x)$ are the largest or smallest element, then one can proceed, as in case 1, to find $U_x$ and $V_x$. If either $g(x)$ or $f(x)$, but not both is a smallest/largest element, then one can proceed as in case 2. Thus, we consider the case where $g(x)$ is the smallest element and $f(x)$ is the largest element. If there is $y$ satisfying $g(x) < y < f(x)$, then we simply let $U_x = (y, f(x)]$ and we can let $V_x = [g(x), y)$. If no such $y$ exists, then let $U_x = (f(x), g(x)]$ and let $V_x = [f(x), g(x))$. 
Since we have shown that neighborhoods $U_x$ and $V_x$ of $f(x)$ and $g(x)$, respectively, exists such that every element of $U_x$ is larger than every element of $V_x$, we see by the continuity of $f$ and $g$ that $f^{-1}(U_x)$ and $g^{-1}(V_x)$ are open in $X$. Thus, $f^{-1}(U_x) \cap g^{-1}(V_x)$ is open in $X$. If $m \in f^{-1}(U_x) \cap g^{-1}(V_x)$, then $f(m) \in U_x$ and $g(m) \in V_x$, so $f(m) > g(m)$, so $m \in X-M \implies f^{-1}(U_x) \cap g^{-1}(V_x) \subseteq X-M$. Since $x \in X-M$ was arbitrary, this shows us that for every element $x$ of $X-M$, there is a neighborhood $B_x$ of $x$ contained in $X-M$. Thus, $$X-M = \bigcup_{x \in X-M} B_x$$
    So, $X-M$ is open, as desired. 
As a side note, perhaps individuals with more experience will see that in the middle of the proof, we also proved that every ordered set $Y$ equipped with the order topology is Hausdorff.