(a) $A=[0,1]\cup[2,3], B=\{1,2\}$
(b) $A=(0,1), B=[0,1]$
(c) $A=\mathbb{Q}, B=\mathbb{Q}$
(d) $A=(0,1)\cup(2,3), B=\{1,3\}$
It was clear for (b) as it was already asked numerous times on this site.
For (c), I took identity map.
For (d), We can send $(0,1)$ to $1$ and $(2,3)$ to $3$. Map is clearly onto and into a discrete space. It is continuous as inverse image of each singelton is open.
What about (a)?
a) $x\mapsto \begin{cases}1&x<\sqrt2\\2&x>\sqrt 2\end{cases}$
b) $x\mapsto \frac{1+\sin 42x}2$
c) $x\mapsto x$
d) $x\mapsto \lceil x\rceil$