I am reading baby Rudin chapter 4 and came across the following theorem:
Suppose $f$ is bijective and continuous from $X$ to $Y$, where $X$ is compact, then its inverse is continuous.
I perfectly understand the proof, however I am unsure why must $X$ be compact? I tried to find a counterexample when $X$ is not compact but couldn't find one. Would the theorem still be true if $X$ is not compact?