Question: Let $X$ and $Y$ be topological spaces and $f$ be homeomorphism from $X-\{x\}$ to $Y-\{y\}$ where $x\in X$ and $y\in Y$. Is it true that the extension $g:X\to Y$ sending $x$ to $y$ is a homeomorphism? ?

---

Attempt: Let $U$ be an open set of $Y$ containing $y$. I want to show that $g^{-1}(U)$ is open. 

Claim 1. $x$ is an interior point of $g^{-1}(U)$

Claim 2. If claim 1 is true then $g^{-1}(U)$ is open since $g^{-1}(U)-\{x\}$ is open

I hope the statement is true but I cannot prove my claims. Thanks for your helps.

Edit: Suppose $X$ and $Y$ are compact topological spaces.

Answer: 
This is in general not true. Consider the two-dimensional unit circle and the interval $(0, 1]$. These two spaces are not homeomorphic, as one is compact and the other one not. But if you remove an arbitrary point on the circle and the point $1$ on the interval, the remaining sets are homeomorphic.
Another example. If $X$, $Y$ are two-point spaces, then the assumption says nothing. Yet, there are non-homeomorphic two-point spaces.