HINT: If $X$ has the discrete topology, every function from $X$ to $Y$ is continuous, and every subset of $X$ is both open and closed. If you choose $Y$ so that it has a subset that isn’t open and a subset that isn’t closed, it’s not hard to get your first example. (You can even take $Y$ to be $X$ with a different topology.)
Suppose that $f:X\to Y$ is an open bijection; then it’s not hard to show that $f$ is also closed. Essentially the same argument shows that a closed bijection is always open. Thus, for the other two examples we cannot use bijections. It turns out that we can use an injection, though.
Let $X=\{0,1\}$ with the indiscrete topology, let $Y=\{0,1,2\}$, with the increasing nest topology
$$\tau=\big\{\varnothing,\{0\},\{0,1\},Y\big\}\;,$$
and let $f(0)=0$ and $f(1)=1$; this will work for one of the other two examples, and I’ll leave it to you to work out which one it is. Finally, you can use $X$ and $Y$ and a different injection from $X$ to $Y$ to get the remaining example.