How to show that $h$ is continuous? 
Claim. Let $f,g:X\to Y$ be two continuous functions where the topology on $Y$ is order topology. Define $h:X\to Y$ as $h(x)=\max\{f(x),g(x)\}$. Then show that $h$ is continuous.

My Attempt (very rough sketch)

Let $V$ be an open set in $Y$. Then there exists $(B_\alpha)_{\alpha\in I}$ such that $$V=\displaystyle\bigcup_{\alpha\in I} B_\alpha$$ where $B_\alpha$'s are basis elements. To show that $h$ is continuous, we need to prove that $h^{-1}(V)$ is open in $Y$. Now, $$h^{-1}(V)=h^{-1}\left(\displaystyle\bigcup_{\alpha\in I} B_\alpha\right)=\displaystyle\bigcup_{\alpha\in I} h^{-1}(B_\alpha)$$Now we do the following procedure. We substitute $f^{-1}(B_\alpha)$ in place of $h^{-1}(B_\alpha)$ if $x\in f^{-1}(B_\alpha)\implies f(x)=h(x)$. Else we substitute $g^{-1}(B_\alpha)$. Now we take the union of all such $f^{-1}$ and $g^{-1}$'s. Let me denote that by $\mathcal{U}$.
Observe that, $x\in h^{-1}(V)$ implies there exists some basis element $B_\alpha$ such that $x\in h^{-1}(B_\alpha)$. So, \begin{align}x\in h^{-1}(B_\alpha)&\implies h(x)\in B_\alpha\\&\implies (f(x)\in B_\alpha)\lor (g(x)\in B_\alpha)\\&\implies (x\in f^{-1}(B_\alpha))\lor (x\in g^{-1}(B_\alpha))\\&\implies x\in \mathcal{U}\end{align}For the reverse part, observe that $x\in \mathcal{U}$ implies that without los of generality there exists some $B_\alpha$ such that $x\in f^{-1}(B_\alpha)$. Now by our construction, \begin{align}x\in f^{-1}(B_\alpha)&\implies (f(x)=h(x))\land(f(x)\in B_\alpha)\\&\implies h(x)\in B_\alpha\\&\implies x\in h^{-1}(B_\alpha)\\&\implies x\in h^{-1}(V)\end{align}

My Questions

*

*Can we justify the substitution of $f^{-1}(B_\alpha)$ (or $g^{-1}(B_\alpha)$) as I described above?


*Can anyone give me some alternative proof of the claim? (If you are going to post an answer to this question, please consider posting an answer of the previous question also.)
 A: Hint:
For $h=\max\{f,g\}$, $h(x)>\alpha$ if and only if $f(x)>\alpha$ or $g(x)>\alpha$. Thus
$\{x\in X:h(x)>\alpha\}=\{x\in X:f>\alpha\}\bigcup\{x\in X:g>\alpha\}$ is open in $X$, since it is the union of two open sets in $X$.
A: Your proof is valid, but it would be better to break it up into stages.  Here's how I would write it:
Lemma Let $X,Y$ be topological spaces, and let $(U_\alpha\colon\alpha\in A)$ be a basis of open sets for $Y$.  Let $f\colon X\to Y$ be a function and suppose that $f^{-1}(U_\alpha)$ is open in $X$ for all $\alpha$.  Then $f$ is continuous.
Proof. We need to show that if $V\subset Y$ is open then $f^{-1}(V)$ is open in $X$.  We may write $V=\bigcup_{\beta\in B}U_\beta$ for some $B \subset A$.  Then
$$
f^{-1}(V)=f^{-1}\left(\bigcup_{\beta\in B}U_\beta\right)=\bigcup_{\beta\in B}f^{-1}(U_\beta)
$$
which is open.  $\Box$
Note: This lemma is very standard, and you can normally use it implicitly in your proofs without having to prove it.  The following is more than enough:

Since $f^{-1}\colon\mathcal P(Y)\to\mathcal P(X)$ preserves unions, it suffices to show that $f^{-1}(U)$ is open for all basic open sets $U$.  

Theorem Let $X,Y$ be topological spaces, and let $Y$ be ordered so that the topology on $Y$ is the order topology.  Let $f,g\colon X\to Y$ be continuous maps.  Then $h(x)=\max\{f(x),g(x)\}$ is continuous.  
Proof.  By the Lemma above, it suffices to show that $h^{-1}(U)$ is open for all basic open sets $U$.  There are two cases:
Case 1: $U=(a,\infty)$ for some $a\in Y$.  I claim that $h^{-1}(U)=f^{-1}(U)\cup g^{-1}(U)$.  Indeed:
\begin{align}
x\in h^{-1}(U) &\Leftrightarrow a<\max\{f(x),g(x)\}\\
&\Leftrightarrow a<f(x)\;\textbf{ or }\;a<g(x)\\
&\Leftrightarrow x\in f^{-1}(U)\cup g^{-1}(U)
\end{align}
Therefore, $h^{-1}(U)$ is open.  
Case 2: $U=(-\infty,a)$ for some $a\in Y$.  I claim that $h^{-1}(U)=f^{-1}(U)\cap g^{-1}(U)$.  Indeed:
\begin{align}
x\in h^{-1}(U) &\Leftrightarrow \max\{f(x),g(x)\}<a\\
&\Leftrightarrow f(x)<a\;\textbf{ and }\;g(x)<a\\
&\Leftrightarrow x\in f^{-1}(U)\cap g^{-1}(U)
\end{align}
Therefore, $h^{-1}(U)$ is open. $\Box$
