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]$.