For the first question, you have $$X=\bigcup_{n\in\Bbb N}(3n,3n+1)\cup\{3n+2:n\in\Bbb N\}$$ and $Y=\big(X\setminus\{2\}\big)\cup\{1\}$. Thus, $$X=(0,1)\cup\{2\}\cup(3,4)\cup\{5\}\cup(6,7)\cup\{8\}\cup\ldots\;,$$ and $$Y=(0,1]\cup(3,4)\cup\{5\}\cup(6,7)\cup\{8\}\cup\ldots\;.$$ You are to consider each of these spaces with the topology that it inherits from the usual topology of $\Bbb R$. Your bijection
$$f:X\to Y:x\mapsto\begin{cases}1,&\text{if }x=2\\
x,&\text{if }x\ne 2
\end{cases}$$
is in fact continuous with respect to these topologies, and you shouldn’t find this too hard to show: the only point of $x$ at which it could possibly not be continuous is $2$, and to show that $f$ is continuous at $2$, just use whatever definition of continuity you have available.
Getting a continuous bijection $g:Y\to X$ is a bit harder. Here’s a hint: find a continuous bijection $h:(0,1]\cup(3,4)\to(0,1)$, and then define
$$g:Y\to X:y\mapsto\begin{cases}
h(y),&\text{if }y\in(0,1]\cup(3,4)\\
y-3,&\text{otherwise}\;.
\end{cases}$$
Don’t try to be fancy with $h$: the simplest possible idea works.
Finally, you’ll have to prove that $X$ and $Y$ aren’t homeomorphic. The key is the point $1\in Y$. Suppose that you have a homeomorphism $h:Y\to X$, and ask yourself where $h(1)$ can be. Show first that it can’t be one of the isolated points of $X$ (e.g., $2,5,8$). Then show that it can’t be in any of the open intervals $(3n,3n+1)$, either; for this you’ll want to use connectedness. For now I’ll not say just how, but if you get stuck, please ask.
Gerry Myerson has explained in the comments what is being asked in the second question, so I’ll leave that alone unless you have further questions.
A very easy example is $\Bbb Z$ with the following topology: negative integers are isolated, and the nbhds of an $n\ge 0$ are the cofinite subsets of $\Bbb Z$ containing $n$. This space is clearly compact and $T_1$, and the map $f:\Bbb Z\to\Bbb Z:n\mapsto n+1$ is a continuous bijection whose inverse is not continuous at $0$.
This comes from the observation that if $\langle X,\tau\rangle$ is a compact $T_1$ space, and $f:X\to X$ is a continuous bijection that is not a homeomorphism, $\tau_f=\{f^{-1}[U]:U\in\tau\}$ must be a topology on $X$ strictly coarser than $\tau$. Fix a point $x_0\in X$, and for $n\in\Bbb Z$ let $x_n=f^{n}(x_0)$, so that $Y=\{x_n:n\in\Bbb Z\}$ is the orbit of $x_0$ under $f$. For each $n\in\Bbb Z$ let
$$\mathscr{U}_n=\{U\in\tau:x_n\in U\}\;;$$
then for each $n\in\Bbb Z$ we must have $\{f^{-1}[U]:U\in\mathscr{U}_n\}\subseteq\mathscr{U}_{n-1}$. If $Y$ is compact and there is at least one $n\in\Bbb Z$ for which the inclusion is strict, then $Y$ and $f\upharpoonright Y$ are also an example. The example in the first paragraph is about the simplest space that one can construct along these lines.
Best Answer
I think it is worth giving a counterexample to the assertion : "continuous bijections are homeomorphisms".
The example is a rather simple one : the identity map is always a bijection. If you take two topologies on a set, one which is (strictly) coarser than the other, then the identity map will be continuous precisely in one direction : from the topology with more open sets to the one with less open sets. The other way, if you take a pullback of an open set which is not in the smaller topology, it won't be open in the smaller topology, hence continuity is not possible.
For example, take $\mathbb R$ with the usual topology, and say $\mathbb R$ with indiscrete/discrete topology with the identity map.
This is an example of a continuous bijection which is NOT a homeomorphism. There are conditions under which a continuous bijection is a homeomorphism (compact to Hausdorff), but it is not true in general.
It is true that $f^{-1}$ is closed : in fact, the fact that $f^{-1}$ carries closed sets to closed sets is equivalent to the continuity of $f$. Therefore, we do not expect this fact to be of help to us in the question. I will expand.
When we look at $[0,1]$ and $(0,1)$ as topological spaces, it is with the subspace topology derived from $\mathbb R$. That is, a description of "open" or "closed" in each of these topologies, is given by the intersection of the set with a set that is open or closed in $\mathbb R$ respectively.
For example :
$[0,1]$ is closed and open in the $[0,1]$ topology, because $[0,1] = [0,1] \cap \mathbb R$, and so it is the intersection of $[0,1]$ with a set both open and closed in $\mathbb R$.
Similarly, $(0,1)$ is both open and closed in the subspace topology derived from $\mathbb R$ (in the subspace topology, not the one on $\mathbb R$).
With this in mind, since the map is from $(0,1)$ to $[0,1]$, the fact that $f^{-1}([0,1]) = (0,1)$ is closed is true, and not a contradiction : this is because $f$, as defined as a topological map, is operating with the subspace topologies, not those directly derived from $\mathbb R$. That is the problem with your logic.