Let $X$ be a metric space.
Suppose $F$ is closed. Suppose $x \notin F$. Then $x \in X - F$. Since $X - F$ is open, $x$ is an interior point. There exists a ball $B$ containing $x$ such that $B \subset X - F$. Hence $B$ does not contain points of $F$.
Suppose $F$ is not closed. Then $X - F$ is not open. Thus there exists a point $x \in X - F$ which is not an interior point. That is, every ball $B$ containing $x$ is not completely contained in $X - F$. Hence there is a point $x$ such that every ball containing $x$ intersects $F$ but $x \notin F$.
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'$.
Best Answer
What you need to remember is that the open ball $B_{\epsilon}(u)$ is defined as: $$B_{\epsilon}(u) = \{x \in X \mid d(x,u)\lt \epsilon\}.$$ That is, the open ball is the collection of all points of $X$ that are less than $\epsilon$ away from $u$.
If $X=[0,1]$, and $U=[0,1]$, then for any $a\in [0,1]$ we have $$B_{2}(a) = \{ x\in [0,1] \mid d(a,1)\lt 1\} = [0,1]\subseteq U$$ Since $B_2(a)\subseteq U$ for all $a\in U$, then $U$ is open according to the definition.
The reason $U$ is closed is that the complement, the empty set, is open.
Same thing with your second example.
That is: you are looking completely inside of $X$; you need to "forget" the fact that $X$ is sitting inside a larger metric space. That does not matter when discussing the topology of $X$, any more than the fact that $\mathbb{R}$ is sitting inside of the plane matters when discussing open sets of $\mathbb{R}$.