A specific bijection which is not a homeomorphism I am looking for a bijection $f$ satisfies the following: $X$ is infinite 1st countable and $f: X = A_1 \cup A_2 \cup A_3 \rightarrow X,$ where $X \cong A_i$'s are pairwise disjoint subsets of $X$ and $f(a) = a$ for all $a \in A_1$
such that $f$ is not a homeomorphism. Otherwise, every such bijection is a homeomorphism.
Remark: $\cong$ stands for: homeomorphic to
 A: Let $C$ be the middle-thirds Cantor set, and let $E$ be the set of endpoints of the open intervals that are deleted in constructing $C_0$; some of the points of $E$ are $\frac13,\frac23,\frac19,\frac29,\frac79$, and $\frac89$. $E$ is a countable dense subset of $C_0$, and $C_0\setminus E$ is also dense in $C_0$. Let $X=\{0,1,2\}\times C$, where $\{0,1,2\}$ has the discrete topology, and for $k\in\{0,1,2\}$ let $X_k=\{k\}\times C$; then $X,C_0,C_1$, and $C_2$ are all homeomorphic to $C$. Now define $f:X\to X$ as follows:


*

*$f(\langle 0,x\rangle=\langle 0,x\rangle$ for each $x\in C$;  

*$f(\langle 1,x\rangle=\langle 1,x\rangle$ for each $x\in E$;  

*$f(\langle 2,x\rangle=\langle 2,x\rangle$ for each $x\in E$;  

*$f(\langle 1,x\rangle=\langle 2,x\rangle$ for each $x\in C\setminus E$; and  

*$f(\langle 2,x\rangle=\langle 1,x\rangle$ for each $x\in C\setminus E$.


This $f$ is a bijection that is the identity on $C_0$ and on the endpoints in $C_1$ and $C_2$, but that interchanges the non-endpoints in $C_1$ and $C_2$. It is not a homeomorphism, because it isn’t even continuous: if $x\in C\setminus E$, there is a sequence $\langle x_n:n\in\Bbb N\rangle$ in $E$ that converges to $x$ in $C$, so the sequence
$$\big\langle\langle 1,x_n\rangle:n\in\Bbb N\big\rangle$$
converges to $\langle 1,x\rangle$ in $X$, but 
$$\big\langle f(\langle 1,x_n\rangle):n\in\Bbb N\big\rangle=\big\langle\langle 1,x_n\rangle:n\in\Bbb N\big\rangle\to\langle 1,x\rangle\ne\langle 2,x\rangle=f(\langle 1,x\rangle)\;.$$
Of course $X$ is not just first countable, but actually metrizable, since it’s homeomorphic to $C$. (See, for instance, this characterization of the Cantor set.)
Added: It is possible to construct an example in which $f$ is a continuous bijection but not a homeomorphism. First construct a first countable space $Y$ that admits a continuous bijection onto itself that is not a homeomorphism. Then let $X=\Bbb Z\times Y$, where $\Bbb Z$ has the discrete topology. For $k\in\{0,1,2\}$ let $Z_k=\{n\in\Bbb Z:n\equiv k\pmod3\}$, and let $X_k=Z_k\times X$; clearly each $X_k$ is homeomorphic to $X$, each is closed in $X$, and $X$ is the disjoint union of the $X_k$. Define
$$g:X\to X:\langle n,x\rangle\mapsto\begin{cases}
\langle n,x\rangle,&\text{if }n\ne 0\\
\langle 0,f(x)\rangle,&\text{if }n=0\;;
\end{cases}$$
then $g$ is a continuous bijection of $X$ onto itself that is the identity on $X_1\cup X_2$ but is not a homeomorphism.
It only remains to construct $Y$ and $f$. Let $S=\left\{\frac1n:n\in\Bbb Z^+\right\}$, and let $$Y=(S\times\Bbb N)\cup\big(\{0\}\times\Bbb Z^+\big)$$ with the topology that it inherits from $\Bbb R^2$. Now define $f:Y\to Y$ as follows:
$$f\left(\left\langle\frac1n,k\right\rangle\right)=\begin{cases}
\left\langle\frac1n,k+1\right\rangle,&\text{if }n>1\text{ and }k>0\\\\
\left\langle\frac1{n-1},1\right\rangle,&\text{if }n>1\text{ and }k=0\\\\
\left\langle\frac1k,0\right\rangle,&\text{if }n=1\text{ and }k>0\\\\
\langle 0,1\rangle,&\text{if }n=1\text{ and }k=0\;,
\end{cases}$$
and $$f\big(\langle 0,k\rangle\big)=\langle 0,k+1\rangle$$ for all $k\in\Bbb Z^+$. It’s easily checked that $f$ is a continuous bijection, but $f$ is not a homeomorphism, since it takes the isolated point $\langle 1,0\rangle$ to the non-isolated point $\langle 0,1\rangle$.
A: Of course not every $X$ is good, for example every bijection on $\mathbb N$ is also an homeomorphism. 
So take $X=\mathbb Q \cap [0,3)$ and let $A_1=\mathbb Q \cap [0,1)$, $A_2=\mathbb Q \cap [1,2)$, $A_3 = \mathbb Q \cap [2,3)$.
Then define $f(x)=x$ if $x \in A_1$, $f(x) = x+1$ if $x \in A_2$, $f(x) = x-1$ if $x\in A_3$. Clearly $f$ is not continuous in $1$ and in $2$.
