If we have a real line and $X$ is any subset of it, let $Y$ be a set such that $X\subseteq Y \subseteq \bar{X}$ If we have a real line and $X$ is any subset of it, let $Y$ be a set such that $X\subseteq Y \subseteq \bar{X}$. Prove that $\bar{X}=\bar{Y}$
My Attempt
We can use definition and show that $\bar{X} $ is in $\bar Y$. For example, let's say we have an element $z$ is $\bar Y$ then for every $\epsilon$ we have to look for an element $x$ in $X$ such that $$|x-z|\leq \epsilon$$ $z$ is in $\bar Y$ so we can have a $y$ in $Y$ such that $$|x-y|\leq \epsilon/2$$ Since $y$ is in $\bar{X}$, we can find an $x$ in $X$ such that $$|x-y|\leq \epsilon /2$$Now how do I put this together with the triangle inequality to draw my conclusion?
 A: As you said, we first show that $\bar{X}\subset\bar{Y}$. Let $z\in\bar{X}$. Let $\epsilon>0$. Since $x\in\bar{X}$, there is an $x\in X$ such that $|x-z|<\epsilon$. Note that $X\subset Y$, and hence, $x\in Y$ too. Thus, for any $\epsilon>0$, there is a $y\in Y$, such that $|z-y|<\epsilon$. I.e., $z\in\bar{Y}$. Therefore, $\bar{X}\subset\bar{Y}$. 
Using a symmetrical argument to the above, we have that $\bar{Y}\subset\bar{\bar{X}}=\bar{X}$. This follows since $Y\subset\bar{X}$.
Hence, $\bar{Y}=\bar{X}$. 
A: Another answer, more general (this property is true in every topological space) :
$\overline{X}$ is the smallest (for the inclusion) closed set that contain $X$
$Y$ is contained in $\overline{X}$ that is closed, so $\overline{Y}\subset \overline{X}$ because $\overline{Y}$ is the smallest closed set that contain $Y$ (hence $\overline{Y}$ smaller than $\overline{X}$)
$X$ is contained in $\overline{Y}$ that is closed (because $X\subset Y \subset\overline{Y}$) , so $\overline{X}\subset \overline{Y}$ because $\overline{X}$ is the smallest closed set that contain $X$ 
And then we have the equality 
