Will the change of codomain of a continuous function affect whether a set is closed (open) in the domain and use nested Intervals theorem in a disc We say that $f: X \to Y$ is continuous if and only if the preimage of open sets in its codomain $Y$ is also open in it's domain $X$. (same for the closed set)
Suppose $B$ is a unit closed ball in $\mathbb{R}^2$,  $B'=B-(0,0)$.  I define the function $d(\cdot,0)$ on $B'$, and this function is measuring the distance of $p$ to the original point. Then I consider sets $B'_t=\{p\in B':d(p,0) \le t\}$ where $t\in (0,1]$.
I think the image of $d(\cdot, 0)$ is just $(0,1]$, and when $p$ is on the boundary of $B'$, $d=1$, and since $B'$ doesn't contain the origin, $d$ can't take zero.
The following is my confusion. If I write $$\begin{align*}
d(\cdot,0):B' \to (0,1]
\end{align*}$$ then $(0,1]$ is both the codomain and the image of $d$ , and $(0,t]$ is a closed set in $(0,1]$ since it's complement is open in $(0,1]$ :  ($(0,t]^c=(t,1]=(0,1] \cap (t,2)$ and $(t,2)$ is open in $\mathbb{R}$). Then under the image $(0,t]$, the preimage of it is just $B'_t$. Since $(0,t]$ is closed in $(0,1]$ and by the continuity of $d$ , $B'_t$ is a closed set in $B'$.
On the other hand, I can also write: $$\begin{align*}
d(\cdot,0):B' \to \mathbb{R}
\end{align*}$$This time, $\mathbb{R}$ is the codomain of $d$ , and the image is still $(0,1]$ . Now it's clear that $(0,t]$ is neither an open nor a closed set in $\mathbb{R}$, so even though $d$ is continuous, we can say nothing about $B'_t$.
Can you tell me what's going wrong here? Thank you very much.

Edit:
This is my other question.
We now know that $B'_t$ is closed in $B'$ (Thanks to the answers). By graph, we can see that $B'_t$  is a shrinking circle without its origin, and as $t$ goes small, $B'_t$ will "converge" to the origin. Since $B'_t$ are nested and closed in $B'$, I think we can use Nested Intervals Theorem, so the infinite intersections of $B'_t$ should converge to a unique point $c$  which is in all $B_t'$. I think $c$ is just the origin, but $c$ is clearly not in any $B'_t$. Thus, what makes this, or am I wrong? Or my argument is right, and this fact implies that $B'$ is not complete space?
 A: As far as I could see, all the posted arguments are correct. Logically it should not cause a confusion, since the statement "$B'_t$ is a closed subset of $B'$" is valid without any reference to the continuous maps $B'\rightarrow (0,1]$ nor $B'\rightarrow \mathbb{R}$.
In other words, for a continuous map $f=d(\cdot,0)$, $B'_t=f^{-1}((0,t])$ can be closed even when $(0,t]$ is not closed in the codomain. I mean, the continuity of $f$ implies only $$C \text{ closed in codomain}\Rightarrow f^{-1}(C) \text{ closed in domain}$$ but not $$C \text{ closed in codomain}\Leftarrow f^{-1}(C) \text{ closed in domain}$$.
By the way, from the continuity of $f=d(\cdot,0)\colon B'\rightarrow \mathbb{R}$, it follows that $f^{-1}((t,\infty))$ is open in $B'$, and we can see that its complement $B'_t$ is a closed subset. I hope this comment clarifies.
A: Let's fix the notation a little: Let $K\in \{(0,1],\mathbb{R}\}$. Define
$$\begin{align*}d_0\colon B'&\to K\\
p&\mapsto d_0(p)=d(p,0).\end{align*}$$
This generalizes the situation and accounts for both cases at the same time.
We have that $$\begin{align}B'_t&=\{p\in B'\mid d(p,0)\leq t\}\\
&=\{p\in B'\mid d_0(p)\in(-\infty,t]\cap K\}\\
&=d_0^{-1}\big((-\infty,t]\cap K\big).\\
\end{align}$$ Since $d_0$ is continuous, $B'_t$ is closed (since $(-\infty,t]\cap K$ is closed in $K$) and the issue is no more. In any case, the set is closed.
