TITLE: Finding counterexamples: bijective continuous functions that are not homeomorphisms
QUESTION [22 upvotes]: 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.

REPLY [6 votes]: Let $f: X \to Y$ be the identity function, where $Y=X$.  It is obvious a bijection. If you need $f$ is continuous mapping,  not a homeomorphism. It only need the topology on $Y$, we say $\tau_Y$, is strictly weaker that the topology $\tau_X$ on $X$. Then $f$ must be continuous, however it is not open, hence it is not a homeomorphism.

Proof: It is continuous. Let $U \in \tau_Y \subseteq \tau_X$, then $f^{-1}(U)= U \in \tau_X$, which witnesses $f$ is continuous. It is not open. There exist $U \in \tau_X \setminus \tau_Y$, then $f(U)=U \notin \tau_Y$, which shows $f$ is not open.

Note Discrete topology is the strongest topology on the given set.  And indiscrete topology is the weakest topology on the given set.
Hope it be helpful for you also.