Are all bijective functions continuous?

To the question in your title and last sentence: it is not true that all bijective functions are continuous.

Consider the function from $\mathbb{R}$ to $\mathbb{R}$ (with the usual topology) given by $$f(x) = \begin{cases} x & \text{ if } x \not \in \mathbb{Z} \\ x + 1 & \text{ if } x \in \mathbb{Z} \end{cases}$$ Then this is a bijective function, sending integers to integers (and shifting them up by $1$) and sending all other real numbers to themselves. But it is not continuous.

Generally, there is no reason to suspect a strong relationship between continuity and bijectivity.


The point $0$ is an isolated point in the set $R=(\leftarrow,1)\cup\{0\}\cup(1,\to)$ that is the range of your function $f$. If you take $f$ as a function from $\Bbb R$ to $R$, $\{0\}$ is an open set in $R$, and $f^{-1}[\{0\}]=\{0\}$ is not open in $\Bbb R$, so $f$ is still not continuous.

One fairly easy bijection from $\Bbb R$ to $\Bbb R$ that is not continuous is the function defined by

$$f(x)=\begin{cases} 0,&\text{if }x=0\\ \frac1x,&\text{otherwise}\;. \end{cases}$$

This function is not continuous at $0$, though it is continuous everywhere else.

In general there is no connection between continuity and bijectiveness.


Your function is not continuous as a function $\mathbb{R}\to\mathbb{R}$, so it cannot be continuous if you limit the codomain to the range (with the relative topology).

I believe the decisive example showing that there is no connection between bijectivity and continuity is the following. Consider two topologies $\tau$ and $\sigma$ on the set $X$. Then the identity map $I_X\colon(X,\tau)\to(X,\sigma)$ is continuous if and only if $\sigma\subseteq\tau$ ($\tau$ is finer than $\sigma$), by definition of continuity. Given two topologies, there is no reason for one to be finer than the other.

If you have a bijective map $f\colon (X,\tau)\to(Y,\sigma)$, you can define a topology $\hat\sigma$ on $X$ by declaring that $U\in\hat\sigma$ if and only if $f(U)\in\sigma$. Then you can check that the continuity of $f$ is equivalent to the continuity of $I_X\colon (X,\tau)\to(X,\hat\sigma)$, so we're again in the same situation as before.

The property of $(X,\tau)$ that

for all topological spaces $(Y,\sigma)$, every bijection $(X,\tau)\to(Y,\sigma)$ is continuous

is only satisfied if $|X|\le1$, so there is only one topology on $X$.

If you restrict to Hausdorff topologies, then the property characterizes finite spaces, as on every infinite set there exists a Hausdorff nondiscrete topology.