non existence of a continuous function with certain conditions I think there is no a continuous map $f:\mathbb{Q} \rightarrow \mathbb{Q}$ such that
$x,y,z$ are distinct rationals and $f(\{z,y\}) = \{x\}$ and $f^{-1}\{x\} = \{y,z\}$ and $f$ is bijective on $\mathbb{Q} - \{y,z\}$.
My try: If it were one, then take the open basic set $x \in (a,b) = (a,x) \cup \{x\} \cup (x,b)$, then $f^{-1}(a,b)$ = open $\cup \{y,z\} \cup $ open = open $\cup \{y,z\}$ open cann't be open as they are pairewise disjoint. Am I right?
 A: Assume that $y<z$. Let $\langle\alpha_n:n\in\Bbb N\rangle$, $\langle\beta_n:n\in\Bbb N\rangle$, $\langle\gamma_n:n\in\Bbb N\rangle$, and $\langle\delta_n:n\in\Bbb N\rangle$ be strictly monotonic sequences of irrational numbers such that $\alpha_n\nearrow y$, $\beta_n\searrow y$, $\gamma_n\nearrow z$, $\delta_n\searrow z$, and $\beta_0=\gamma_0$. Let $L=\Bbb Q\cap(\leftarrow,\alpha_0)$ and $R=\Bbb Q\cap(\delta_0,\to)$. For $n\in\Bbb N$ let $A_n=\Bbb Q\cap(\alpha_n,\alpha_{n+1})$, $B_n=\Bbb Q\cap(\beta_{n+1},\beta_n)$, $C_n=(\gamma_n,\gamma_{n+1})$, and $D_n=\Bbb Q\cap(\delta_{n+1},\delta_n)$.
Let $\langle\eta_n:n\in\Bbb N\rangle$ and $\langle\rho_n:n\in\Bbb N\rangle$ be strictly monotonic sequences of irrational numbers such that $\eta_n\nearrow x$ and $\rho_n\searrow x$. Let $L'=\Bbb Q\cap(\leftarrow,\eta_0)$ and $R'=\Bbb Q\cap(\rho_0,\to)$, and for $n\in\Bbb N$ let $E_n=\Bbb Q\cap(\eta_n,\eta_{n+1})$ and $F_n=\Bbb Q\cap(\rho_{n+1},\rho_n)$.
$L,L',R,R'$, and all of the sets $A_n,B_n,C_n,D_n,E_n$, and $F_n$ are homeomorphic to $\Bbb Q$, and all are clopen subsets of $\Bbb Q$, so the following order-isomorphisms (which are also homeomorphisms) exist:
$$\begin{align*}
g_L&:L\to L'\\
g_R&:R\to R'\\
g_{A_n}&:A_n\to E_{2n}\\
g_{B_n}&:B_n\to E_{2n+1}\\
g_{C_n}&:C_n\to F_{2n+1}\\
g_{D_n}&:D_n\to F_{2n}
\end{align*}$$
Let $$f=\{\langle y,x\rangle,\langle z,x\rangle\}\cup g_L\cup g_R\cup\bigcup_{n\in\Bbb N}\left(g_{A_n}\cup g_{B_n}\cup g_{C_n}\cup g_{D_n}\right)\;;$$
then $f:\Bbb Q\to\Bbb Q$ is continuous, $f(y)=f(z)=x$, and $f\upharpoonright\left(\Bbb Q\setminus\{y,z\}\right)$ is a homeomorphism onto $\Bbb Q\setminus\{x\}$.
(I strongly recommend drawing a picture of the decompositions of the domain and range.)
A: To flesh out my hint at a modificaiton of a previous answer, let us suppose for the sake of simplicity at the moment that $x = 0$.  Divide $\mathbb{Q} \setminus \{ 0 \}$ into two sets $S,T$ consisting of those (nonzero) rational numbers whose denominator is even (odd) when put into lowest terms.  Further, let $S_-$ ($S_+$) consist of the positive (negative) elements of $S$, respectively.  And similarly define $T_-$, $T_+$.
Pick an irrational number $\gamma$ between $y$ and $z$ (say $y < \gamma < z$).  Let
$$\begin{align}
U_- &= \mathbb{Q} \cap ( -\infty , y ); & U_+ &= \mathbb{Q} \cap ( y , \gamma ) \\
V_- &= ( \gamma , z ); & V_+ &= \mathbb{Q} \cap ( z , + \infty ).
\end{align}$$
Note that each of the sets $S_-, S_+ , T_- , T_+$ as well as $U_-, U_+, V_-, V_+$ is a densely ordered subset of $\mathbb{Q}$ without maximum or minimum elements, which means that they are all order-isomorphic to $\mathbb{Q}$ (and therefore to each other).  We can then fix order isomorphisms (and hence homeomorphisms):
$$\begin{gather}
f_- : U_- \to S_- \\
f_+ : U_+ \to S_+ \\
g_- : V_- \to T_- \\
g_+ : V_+ \to T_+.
\end{gather}$$ Now define a function $h : \mathbb{Q} \to \mathbb{Q}$ by
$$h(q) = \begin{cases}
f_- ( q ), &\text{if }q \in U_- \\
0,         &\text{if }q = y \\
f_+ ( q ), &\text{if }q \in U_+ \\
g_- ( q ), &\text{if }q \in V_- \\
0,         &\text{if }q = z \\
g_+ ( q ), &\text{if }q \in V_+ \\
\end{cases}$$
It is fairly easy to see that $h$ is continuous, that $h(y) = h(z) = 0$ and that $h$ maps the set $\mathbb{Q} \setminus \{ y,z \}$ bijectively onto $\mathbb{Q} \setminus \{ 0 \}$.
(For arbitrary $x \in \mathbb{Q}$ you can just take $h^\prime (q) = h(q) + x$.)
