Prove that an open interval and a closed interval are not homeomorphic

Here's a proof not using connectedness properties.

Suppose $f: [a,b] \to (c, d)$ is a homeomorphism. Observe that $f(a)\not=f(b)$ as $f$ is injective and consider the point $f(a)+f(b)\over 2$ at half the distance between $f(a)$ and $f(b)$. As $f$ is surjective, $f(x) = {f(a)+f(b)\over 2 }$ for some $x \in [a,b]$.

Now let $\delta$ be enough for both the distances between $f(x)$ and $f(a)$, and between $f(x)$ and $f(b)$ to be less than $\delta$ and yet the open interval centered at $f(x)$ of radius $\delta$ not to cover the whole $(c,d)$.

As $f$ is continuous, there must be an open interval centered at $x$ large enough to contain both $a$ and $b$ and whose image under $f$ is within a distance of $\delta$ from $f(x)$. As such an interval must ecompass the whole $[a,b]$, the function $f$ cannot be surjective for $\delta$ is chosen in such a way that there're points in $(c,d)$ with a distance from $f(x)$ greater than $\delta$.


If we remove either $c$ or $d$ from $[c,d]$ we get a connected subspace.

If we remove any point $\gamma$ from $(a,b)$, the resulting subspace $J$ can be written as

$\tag 1 J = (a, \gamma) \sqcup (\gamma, b)$

which is a disconnected space.

If $(a,b)$ was homeomorphic to $[c,d]$, removing some point from $(a,b)$ would give us a connected space. But this contradicts (1).


Or one can do the following. By scaling arguments one can show that $(0,1)$ is homeomoprhic to $(a,b)$ and $[0,1]$ to $[c,d]$. Now, $(0,1)$ is not compact but $[0,1]$ is. I learned compactness before connectedness. I am using $(0,1)$ and $[0,1]$, because those I think are the most famous examples of non-compactness and compactness.


Hint

Suppose this was true, and $\exists f:(a,b)\longrightarrow [c,d]$, where $f$ is a homeomorphism.

Now, consider the inverse image of $f$, $g=f^{-1}$, which must be a homeomorphism.

As Daniel Fischer suggests, look at the image under $g$ of a set in $[c,d]$ less a particular point. Another useful property you may wish to consider is the fact that the homeomorphism $g$ is (1) an open mapping and (2) preserves connectivity by continuity.