Closed interval is open depending on the space? As an example related to an earlier question (Image of open set is not open?), an answerer defined a function
$$
f: [0,1) \cup [2,3] \to [0,2], \; f(x) = \begin{cases}x , & x \in [0,1) \\ x-1, & x \in [2,3] \end{cases},
$$
and mentioned that "The set $[2,3]$ is open in $[0,1)∪[2,3]$".
Given that the set $[2,3]$ is open, the set $[0,1)$ should be closed, but am not able to see how this can be?
 A: If $A\subset B$, it's entirely possible for a set $S$ to be open in $A$ but not in $B$. 
With your example, let's think about why we expect $[2,3]$ to not be open; in $\Bbb{R}$, we cannot have an open ball centered at $2$ contained in $[2,3]$, so $[2,3] $ is not open in $\Bbb{R}$. Now let $S = [0,1)\cup [2,3]$. $[2,3]$. Take the open ball of radius $1/2$ centered at $2$. This is defined as the set
$$\{x\in S : |2-x|<1/2\} = S\cap (1.5,2.5) = [2,2.5)$$
Which is contained in $[2,3]$. We can similarly have an open ball in $S$ centered at $3$ contained in $[2,3]$, and so $[2,3]$ is open in $S$. 
Generally speaking, say we have a topological space $X$, and $Y\subset X$. Then by the definition of the subspace topology, $A\subset Y$ is open in $Y$ iff $A = Y\cap O$ where $O$ is open in $X$ (can you see why this holds in a metric space?). This applies in your example, since $[2,3] = S\cap (1.9,3.1)$, and so $[2,3]$ is open in $S$. 
A: Being open depends on many concepts actually, the first and more important one is your definition of the topology ($\tau$) on that topological space $X$. You see being "open" is just a synonim for "cointeined in $\tau$", therefore $A=[a,b]$ is open iff $A\in\tau$. Now, you have to remind yourself the basic axioms for $\tau$ which are:


*

*$\emptyset, X\in\tau$.

*For all $\chi\subseteq\tau$ you have $\bigcup\chi\in\tau$ (union of opens are open).

*$U,V\in\tau$ implies $U\cap V\in\tau$ (finite intersections of opens are open).


An eample of topology that has closed intervals as open sets is the discreet topology (such that all posible subsets of a space are open). Also, you could define topologies throught a base $\beta$, which is defined by the following axioms:


*

*For all $x\in X$ exists $B\in\beta$ such that $x\in B$.

*For all $B_1,B_2\in\beta$ iff $x\in B_1\cap B_2$ then exists $B_3\in\beta$ such that $B_3\subseteq B_1\cap B_2$.


Elements contained in a base are called "basics", all posible unions of basics are open. You could define a base such that $\beta=\{[x-r,x+r]:x,r\in\mathbb{R},r>0\}$, where closed intervals are open.
Finally, the last method is that you could define a topological subspace $X\subset\mathbb{R}$ such that if $U$ is open in $\mathbb{R}$, then $U\cap X$ is open in $X$, notice that if $[1/2,1]$ is a subspace, then $[0,2]$ is open in that subspace, since $(0,2)\cap[1/2,1]=[0,2]\cap[1/2,1]$.
