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?

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 
