Confused about a particular set and closedness

I was given the problem to show that for the metric space $$(\mathbb{R}^2,d)$$ with $$d$$ the Euclidean distance, the set $$D = \left\{(x,x)\in \mathbb{R}^2: x \in [0,1] \right\}$$ is closed. This was easy enough, since I can show that for any point $$(a,a)$$ on this line, any open ball with radius $$\varepsilon>0$$ around $$(a,a)$$ would have points outside of $$D$$ (say for example the point ($$-\varepsilon/\sqrt{2}+a,\varepsilon/\sqrt{2}+a$$), this is $$\varepsilon$$ distance away from $$(a,a)$$ and clearly is not an element of $$D$$). This showcases every point on $$D$$ is a boundary point of $$D$$, and the boundary of any set is closed, hence $$D$$ is closed.

I then went to change the set by changing the possible values of $$x$$, hence I got the set $$E =\left\{(x,x)\in \mathbb{R}^2: x \in (0,1] \right\}$$. This shouldn't be a closed set, since the point $$(0,0)$$ is a limit point in $$E$$ (take the sequence $$((1/n, 1/n))_{n\geq 1} \in E$$). However, I get confused since the "open ball around $$(a,a)$$ method" I did for $$D$$ seems fine in this case too, since I can give the same arguments as in the case $$D$$. Can anyone give me a good explanation on why this method has to fail for the set $$E$$?

open ball around the origin, regarding set $$E$$, yes the same argument shows that the origin is a boundary point for $$E$$. The origin is also a limit point for $$E$$, as you said. Since $$(0,0) \not\in E$$, that is it. $$E$$ is not closed for that reason.
I think your trouble is you have a method that works in the special case when $$M=\partial M$$, e.g. when $$M=D.$$ But $$E\not=\partial E$$, so you need a different approach for set $$E$$.
• $\partial M$ means "the boundary of $M$" Commented Nov 23, 2021 at 23:09