> 
> Let $f: X \to Y$ be a bijective continuous function. If $X$ is compact, and $Y$ is Hausdorff, then $f:X \to Y$ is a homeomorphism.
> 
> 
> 

My goal is to demonstrate the necessity of both the compact and Hausdorff property of $X$ and $Y$ respectively. I want to know if my counter examples are correct:

Let $f: X \to Y$ be the identity function. 

(1) Let $X=[0,1]$ with the standard topology and let $Y=[0,1]$ with the indiscrete topology. Then $f: X \to Y$ is continuous and bijective but not a homeomorphism. Since $U=(1/3,1/2)$ is open in $X$, but $(f^{-1})^{-1}(U)=f(U)$ is not open in $Y$.

(2) Let $X=Y=\mathbb{R}$. Let $Y$ have the standard topology and $X$ have the discrete topology. Let $U=\{x\}$ since open sets are singletons. $f(^{-1})^{-1}(x)=f(x)$ is closed in $Y$ since $Y$ has the standard topology. Hence $f$ is not a homeomorphism.

**This is the old question**  

My goal is to demonstrate the necessity of both the compact and Hausdorff property of $X$ and $Y$ respectively. I want to know if my counter examples are correct:

Let $f$ be the identity function. Then $f: X \to Y$ be a bijective continuous function. If $X=[0,1]$ with the standard topology and $Y=[0,1]$ with the indiscrete topology we have that $f:X \to Y$ is not a homeomorphism.

Let $f: X \to Y$ be a bijective continuous function, $X=(0,1)$, and $Y=[0,1]$ both with the standard topology. It's not a homeomorphism because $f^{-1}([0,1])$ is not connected, but $[0,1]$ is connected.

The first shows why Hausdoff is necessary for $Y$ and the second shows compactness is necessary for $X$.

Are both of the examples correct? I have no confidence in my first example because I'm having problems showing $f^{-1}$ is not continuous. However, I am confident in my second example.