General topological space $2$. 1. Let $A\subset X$ be a closed set of a topological space $X$. Let $B \subset A$ be a subset of $A$. prove that $B$ is closed as a subset of $A$, if and only if $B$ is closed as a subset of $X$.
What I have done is that if $B$ is closed in $A,B$ should be the form of $A\cap C$ where $C$ is closed in $X$... ( I don't know whether this is true or not..) anyway, then, $A$ and $C$ is all closed in $X$. Hence, $B$ also should be closed in $X$. I think this is just stupid way. I don't know how to prove solve this problem.
2. If we omit the assumption that $A$ is closed, show that previous exercise is false.
What I have done is that if I let $X=R$ and $A=(0,1)\cup(2,3)$ in $R$, although the interval $B=(0,\frac{1}{2}]$ is a subset of $A$ and closed in $A$, it is not closed in $X$. and I don't know the opposite way.
please help me.

The first proof is correct, minus the remarks about stupidity. It could use a slight rewording, but the idea is correct.
The second example is also correct, you are supposed to find a non-closed $A$ and $B\subseteq A$ which is closed in $A$ but not closed in $X$. You can do with a simpler example, though.
