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.
Thanks for reading.
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$.