Can we have a continuous bijective function that maps closed intervals to open intervals? In an exercise I'm asked the following question:

Let $(\mathbb R, \tau_1)$, with $\tau_1=\{\mathbb R,\emptyset\} \cup \{(-n,n),n\in \Bbb N\}$ and $(\mathbb R, \tau_2)$, with $\tau_2=\{\mathbb R,\emptyset\} \cup \{[-n,n],n\in \Bbb N\}$ be two topological spaces. Then is it true that: $(\mathbb R, \tau_1) \cong (\mathbb R, \tau_2)$?

So what I did was the following:
Lets assume that $(\mathbb R, \tau_1) \cong (\mathbb R, \tau_2)$. Then let $f: (\mathbb R, \tau_2) \to (\mathbb R, \tau_1)$ be an homeomorphism.
We have that $[-i,i] \in \tau_2$ with $ i \in \Bbb N$. Then we have that $f([-i,i]) \in \tau_1$. This means that: $$f([-i,i])=(-k,k),\ \ k \in \Bbb N$$
So we have a function $f: \Bbb R \to \Bbb R$ such that $f$ is a bijection, is continuous, $f^{-1}$ is continuous, and, for each $i \in \Bbb N$, then $f([-i,i])=(-k,k)$  for some $k \in \Bbb N$.
My question is: Does such function exists? Can we have that takes one closed interval and gives us an open interval and still be bijective and continuous? If so, how can we write $f(x)$? If not, then how can I prove it?
 A: You do not need continuity in the usual sense. If for all $i$, you can find
$$\tag{1} f^{-1} ([-i, i]) = (-k, k)$$
for some $k$, then $f$ is continuous between the topological spaces $(\mathbb R, \tau_1), (\mathbb R,\tau_2)$.
So all you need is that $f$ is bijective which satisfies (1). We can actually construct such an $f$ easily: define $f$ to be a bijection
\begin{align}
 (-1, 1) &\to [-1, 1], \\
(-2, -1] \cup [1, 2) &\to [-2, 1) \cup (1, 2], \\
\vdots \ \ \ \ \ \  & \ \ \ \ \ \ \ \ \ \ \ \ \ \vdots \\
(-n,-n+1] \cup [n-1, n) & \to [-n, -n+1) \cup (n-1, n] 
 \end{align}
and so on (to construct a bijection $(-1, 1)\to [-1, 1]$, see here for a similar construction). Then $f$ is bijective and
$$ f^{-1}([-n, n]) = (-n, n)$$
for all $n\in \mathbb N$
Remark: I am assuming $0\notin \mathbb N$. If instead $0\in \mathbb N$, then in $\tau_2$ we have the set $\{0\} = [-0,0]$, which has only one element. Thus $(\mathbb R, \tau_1)$ is not homeomorphic to $(\mathbb R, \tau _2)$ since in $\tau_1$ there is no open $\tau_1$-open set with exactly one element.
