I have read that $\{(x, \frac{1}{x}): x \neq 0\}$ is closed in $\mathbb{R^2}$.
So hence the complement of this set, $\{x = 0\}$, i.e. the y-axis must be open? But we cannot put an open ball with radius $r > 0$ on any point in the $y$ axis without that ball no longer being fully contained in the y-axis. So how can it be open?
The $y$-axis can be characterized as the set $$ \{(x,y):x=0\} $$ and so it's closed, because the projection to the first coordinate is continuous.
This set is definitely not the complement of $$ H=\left\{\left(x,\frac{1}{x}\right):x\ne0\right\} $$ because, for instance, $(2,2)$ belongs to the complement of $H$ but not to the $y$-axis.