# Example of open/closed sets

Let $Y$ be a subset of $X$, with $X$ a metric space with metric $d$. Give an example where $A$ is open in $Y$, but not open in $X$.

Give an example where $A$ is closed in $Y$, but not closed in $X$.

For the first case, I can let $Y$ be the interval $[0,1]$ and $X$ be the interval $(0,1)$. How is this rigorously proved?

For the second case, I can let $Y$ be $(0,1)$ and $X$ be $[0,1]$.

-
In the first case, you need $Y$ to be a subset of $X$. Is $[0,1]$ a subset of $(0,1)$? Moreover, the problem asks you to give an example of a set $A$ with certain properties; you have not done so. All you've done is say what you are going to let $Y$ and $X$ be (and what you've said fails to satisfy the very first statement in the problem). When the problem says "Give an example where $A$ is ..." and your answer does not contain the words "Let $A$ be...", then chances are pretty high that your answer is incorrect. – Arturo Magidin Nov 6 '11 at 5:26
Note if you take $Y = [0,1]$ and $X=(0,1)$, then you actually violate the condition that $y \subset X$. – Rankeya Nov 6 '11 at 5:33

Try something like $Y=[0.5,0.75]$, $X=(0,1)$ and $A=Y$ for the example of a subset $A$ of $Y$ that is open in $Y$ but not in $X$.
For the second case try $Y=(0.5,0.75]$, $X=[0,1]$ and $A$ = $Y$.