Generalizing a theorem from real analysis regarding strictly increasing functions This is a question of my own asking, originating from a misinterpretation of OP's question in this thread where I  accidentally proved the following:

Theorem: A continuous function $f:[a,b] \to \mathbb{R}$ that is strictly increasing on $(a,b)$ is also strictly increasing on $[a,b]$.

Proof:
Assuming $f:[a,b] \to \mathbb{R}$ is a continuous function, we'll have $f\Big( (a,b) \Big) = (c,d)$ for some $c,d \in \mathbb{R}$ because the continuous image of a connected set is connected.  Note that this fact also implies $f(b) = w$ for some $w \in [c, d]$.  Now let's suppose $f(b) \neq d$; i.e. suppose $w \in [c, d)$.  Consider the preimage of the interval $U = (w- \varepsilon, \ w + \varepsilon)$, where $0 < \varepsilon < |d-w|$.  It would look like $f^{-1}(U) = V \cup \ \{b\}$, where $V$ is such that $\{b\}$ is isolated.  Due to this isolated point, $f^{-1}(U)$ cannot be open.  Because $U$ is an open set and $f^{-1}(U)$ is not, $f$ cannot be continuous.  Thus, continuity forces $f(b) = d$, just as it does $f(a) = c$ by an analogous argument.

Having done this, I wondered how easy it would be to adapt the underlying strategy to prove a more general topological statement, and I arrived at this hypothesis (wrong: see Eric Wofsey's post):

Let $X$ be a Hausdorff space, $U \subset X$ an open set, and $f: \overline{U} \to Y$ a continuous function into a locally compact Hausdorff space where $f:U \to f(U)$ is a homeomorphism.  Then $f: \overline{U} \to f(\overline{U})$ is also a homeomorphism.

Some thoughts:
Per this fact, I know that it suffices to prove that the restriction of $f$ to the boundary $\partial U$ of $U$ is bijective.  This is why I have chosen the "locally compact Hausdorff" condition: I think it might help me guarantee injectivity.  To wit, let's suppose $f(p) = f(q)$ for $p, q \in \partial U$.  Per Hausdorffness, we can separate $p$ and $q$ with disjoint open neighboorhoods $S_p$ and $S_q$.  Next, the image of $S_p$ will be a neighborhood of $f(p)$, which necessarily contains an open neighborhood of $f(p)$ per local compactness.  Then the preimage of this set will have $\{q\}$ as an isolated point, so it cannot be open and thus $f$ would be discontinuous (this feels hand-wavy, as if I'm missing something and don't know what).
Questions:

*

*Which bits of the above are wrong?

*What is the most general statement one can make here?

*How can I tackle surjectivity?  I have a few vague ideas that could make this easier, such as requiring the boundaries of each connected component of $U$ to be connected, but these are largely unsubstantiated hunches, and I feel trying to justify them here would detract from the post.


To encourage as much discourse as possible, I'm willing to both accept an answer and award a bounty on a second for substantial replies, assuming I get more than one.  Meaty partial answers encouraged.
 A: This is just horribly false.  For instance, even in just the case where the domain is an interval $[a,b]$, consider the map $f:[0,2\pi]\to S^1$ given by $f(t)=e^{it}$.  Then $f$ is an embedding on $(0,2\pi)$, but $f$ is not injective.
It's not even true if you restrict to (say) open subsets of $\mathbb{R}^n$ and maps to $\mathbb{R}^n$.  For instance, the map $f:[0,1]^2\to\mathbb{R}^2$ given by $f(x,y)=(x,xy)$ is an embedding on its interior (an open subset of $\mathbb{R}^2$) but is not injective on the boundary since it collapses the entire boundary edge $\{0\}\times[0,1]$ to a point.
Your argument goes wrong when it asserts that the image of $S_p$ is a neighborhood of $f(p)$.  That's not necessarily true (indeed, in the example above, the image of $[0,1)$ is not a neighborhood of $f(0)$, for instance).
A: I don't know if I am missing something but your statement looks wrong. $e^{ix}$ is a continuous map from $[0,2\pi]$ into $S^{1}$ and it is a homeomorphism om $(0,2\pi)$. But this map is not injective on $[0,2\pi]$. 
