I'm absolutely not sure if I got this right (I don't think I did), so it would be great if someone could check if my "proof" makes sense or not. I have to determine whether the set $$B := \mathbb{R}^2 \setminus \left\{\left(x, \sin\left( \frac{1}{x}\right)\right) : x \in \mathbb{R} \setminus \{0\} \right\}$$ is open or not.
What I did so far:
If $B$ is open, then the set $B^{\complement} := \left\{\left(x, \sin\left( \frac{1}{x}\right)\right) : x \in \mathbb{R} \setminus \{0\} \right\}$ should be closed.
Let's consider a singleton $b_n:=\{(x_n, \sin(\frac{1}{x_n}))\}$ where $x_n \ne 0$ and $n \in \mathbb{N}$.
What I would like to do is to show that each such singleton is closed, so that each set $\mathbb{R}^2 \setminus \{(x_n, \sin(\frac{1}{x_n}))\}$ is open, and therefore the union of all of them is open, that is: $B$ would be open. I'm not sure if it makes sense or not.
To show that a singleton is closed, we could let $y_n := (x_n, \sin(\frac{1}{x_n}))$ and let $\{y_n\} \subseteq b:=(x, \sin(\frac{1}{x}))$ be a convergent sequence (not sure if that's possible though, since $\sin(\frac{1}{x})$ is not well-known to be convergent). If that could be a thing, we would have $y_n = (x, \sin(\frac{1}{x}))$ (because $y_n \subseteq b$, with $b$ containing the single point $(x, \sin(\frac{1}{x}))$) and so $y_n \rightarrow (x, \sin(\frac{1}{x})) \in b$. Therefore, each $b_n$ would be closed and the union of all $\mathbb{R^2} \setminus \{(x_n, \sin(\frac{1}{x_n}))\}$ with $x_n \ne 0$, $n \in \mathbb{N}$ is open.
...Now that I read all this again, I feel like this is terribly wrong. Therefore, it might be that $B$ is not open. But if that's the case, I'm stuck at finding any counterexample of an open ball that would not be in $B$... Any help would be greatly appreciated!
Your feeling is correct. :P Singletons are always closed because $\mathbb{R}^n$ is T1. That's one thing. The other is that $B$ is not a union of complements of singletons. Actually if $x, y$ are two different points, then $(X\backslash\{x\})\cup(X\backslash\{y\})=X$. So your $B$ is actually an intersection of complements. However infinite intersections need not be open.
Now your first step was correct. It is enough to show that the graph of a continous function is closed. For that see this:
Why is the graph of a continuous function to a Hausdorff space closed?
Now the last problem is: the complement of the graph should be open in what? In codomain? In $\mathbb{R}^2$?
Denote by $f(x)=\sin(\frac{1}{x})$. What the article above proves is that the graph
$$Gr(f)=\{(x,f(x))\ |\ x\in\mathbb{R}\backslash\{0\}\}$$
is closed in $Y=\mathbb{R}\backslash\{0\}\times\mathbb{R}$. So the complement $Y\backslash Gr(f)$ is open in $Y$. But $Y$ is open in $\mathbb{R}^2$ and thus the complement of graph is also open in $\mathbb{R}^2$.
However note that $B\neq Y\backslash Gr(f)$ (thanks @Bib-lost for realizing that). They are almost equal, note that the graph is defined in $\mathbb{R}\backslash\{0\}\times\mathbb{R}$. Thus
$$B=(Y\backslash Gr(f))\cup\{(0,r)\ |\ r\in\mathbb{R}\}$$
This set is not open in $\mathbb{R}^2$. That's because there is no open neighbourhood of $(0,0)$ which does not intersect the graph $Gr(f)$.