Let $X$ and $Y$ are ordered set in the order topology. Show that if $f:X\rightarrow Y$ is order preserving and surjective, then $f$ is a homeomorphism.
My attempt:
Simply $f$ is bijective (take $x<y\Longleftrightarrow f(x)<f(y)$ to reduce cases.). Easy to see that $f([a,b])=[f(a),f(b)]$. Let $A$ be a connected subset of $Y$. Then $\color{red}{\bar A=[\inf A,\sup A]}$. So $f^{-1}(\bar A)$ is closed set. Again if $B,C$ are two disjoint connected open sets, then $f^{-1}(B\cup C)=f^{-1}(B)\cup f^{-1}(C)$.
Is my proof ok.(Mainly the red part?)
I don't see why you need connectedness at all. Check that $f$ is continuous and its inverse $g$ as well. $f$ continuous is clear as $f^{-1}[(a,\rightarrow)] = (g(a), \rightarrow)$ as $f$ is strictly increasing. Similarly for the other subbasic elements $(\leftarrow, a)$: $f^{-1}[(\leftarrow,a)] = (\leftarrow, g(a))$. As $f$ is a strictly increasing function, so is $g$, and the same argument applies to show $g$ is continuous.