Open and closed sets in a metric space I'm having a little trouble understanding the definition of open and closed set in a metric space.
I'm going to use an excersize:

Lets consider $Y:=(-1,1]$ with the usual metric of $\Bbb R$. Decide whether these sets are open or closed in $Y$:
   (i) $(-1,1]$
   (ii) $(-\frac 12,0]$
   (iii) $(-1,0]$

(i) I say is open, since there's a proposition somewhere that says: 

Every metric space is open in itself

Maybe the proof needs a little clarification for me. Says that we can take any $x\in X$ and for every $\varepsilon >0$ we get that $B_X(x,\varepsilon)\subset X$, hence every elemente in $X$ is an interior point. I don't see why this is true, if we suppouse that $X$ has an element such that it is a contact point (I belive we can assume that since the only hypothesis is that $X$ is a metric space), then we can't find any open ball that stays completly in $X$, I know I'm missing something, but I can't see what, (I know is not the same to say open in $\Bbb R$). Also, is there an analogue version of this but with closed? like, every set is closed in itself?


(ii)I say this isn't nor open nor closed, since $0$ is a contact point and $-\frac 12$ is too a contact point but is not included in the set. Am I using the definition of contact point well for these points? Also, in wich case this set would be closed? maybe if we had $[-\frac 12,0]$?


(iii)I think is closed, since it contains all of its contact points. Is it ok for me to think that $-\frac 12$ is a contact point? I think it is, since for every $\varepsilon>0$ we have that $B_X(-\frac 12,\varepsilon) \cap (-1,0]\neq \varnothing$.
 A: Another approach:
Suppose we have some metric space $(M,d)$, and a subset $M' \subset M$. Then $(M',d)$ is a metric space as well. Then a set $U' \subset M'$ is open iff there is some open $U \subset M$ such that $U'=U \cap M'$. This is fairly straightforward to prove. It is also straightforward to prove the corresponding result for closed sets.
In your examples, $M=\mathbb{R}$ with the usual metric and $M'=(-1,1]$. So, your examples can be written as:
(i) $(-1,1] = \mathbb{R} \cap M'$, so $(-1,1]$ is both open and closed in $Y$.
(ii) Needs a little more attention. If $(-\frac{1}{2}, 0] = U \cap M'$, where $U$ is open in $\mathbb{R}$, then we would also have $(-\epsilon,\epsilon) \subset (-\frac{1}{2}, 0]$ for some $\epsilon>0$, so it cannot be open. Similarly, if $(-\frac{1}{2}, 0] = C \cap M'$, where $C$ is closed in $\mathbb{R}$, then we would also have $\frac{1}{2} \in (-\frac{1}{2}, 0]$, so it cannot be closed.
(iii) $(-1,0] = (-\infty,0] \cap M'$, so $(-1,0]$ is closed in $M'$, and the same line of reasoning for (ii) shows that it cannot be open in $M'$.
A: use the result. Let $X$ be a metric space and $A$ be a subspace (i.e. a subset of $X$ which os a metric space in its own right) of $X$. A set $B$ in $A$ will be open if there is a open set $C$ in $X$ s.t. $B = A \cap C$. Similarly $B$ will be closed in $A$ if there is a closed set $C$ in $X$ s.t. $B = A \cap C$. Convers are also true. You shall get the proofs in any standerd book of metric space.
Now apply this result on your examples one by one.


*

*$(-1,1]$ is an intersection of $(-1 , 2)$ (which is open in $\mathbb{R}$) with $Y$ ans so open. Also it is an intersection of $[-1,1]$ (closed in $\mathbb{R}$) with $Y$. So $(-1,1]$ is closed in $Y$.

*$(-\frac{1}{2},0)$ is not an intersection of $Y$ with any open set or closed set of $\mathbb{R}$. So it is neither open nor closed in $Y$.

*$(-1,0]$ is an intersection if $Y$ with $[-1,0]$ which is closed in $\mathbb{R}$ and so closed on $Y$.  
