# How to show that the given set is open?

Consider the following subsets of the plane $$\mathbb{R}^2$$:

$$X=\{(x,y)|y=0\}\cup \{(x,y)|x>0\text{ and}\; y=1/x\}$$

How to show that $$A$$ and $$B$$ are open in $$X$$ under subspace topology. Efforts:

Let's define $$A=\{(x,y)|y=0\}$$ and $$B=\{(x,y)|x>0\text{ and}\; y=1/x\}$$.

To show that $$A$$ is open I need to find an open set $$N$$ of $$\mathbb{R}^2$$ such that $$X\cap N=A$$. I am not able to proceed further.

I welcome any hints.

Note that both $$A$$ and $$B$$ are closed in $$\mathbb R^2$$ (why?), and so $$M:=\mathbb R^2\backslash B$$ and $$N:=\mathbb R^2\backslash A$$ are open in $$\mathbb R^2$$. Consequently, since $$X=A\cup B$$ and $$A\cap B=\emptyset$$, we have $$A=X\cap M$$ and $$B=X\cap N$$, showing that both $$A$$ and $$B$$ are also open in $$X$$.
Note that this implies that $$A$$ and $$B$$ are also closed in $$X$$, since $$A=X\backslash B$$ and $$B=X\backslash A$$.
Hint: It might be easier to show that both $$A,B$$ are closed in $$X$$, and then since $$X = A \cup B$$, we immediately have that $$A,B$$ are both open in $$X$$.