Determine the following set is open or closed in $\mathbb{A}^2$ Let $k$ be a field.
Consider the set $$S=A_1\cup \{( 0,0)\}$$ where $A_1=\{(x,y):x\neq 0,y\in k\}$

How do we determine whether this set is open or closed in $\mathbb{A}^2$?

My Attempt: Note $A_1^c=\{(0,y):y\in k\}$, and $A_1^c=V(x,xy)$. Thus $A_1$ is open as the complement is closed. Then note $\{(0,0)\}$ is closed, so $S$ is a union of two disjoint sets where one is open and another is closed. Thus itself cannot be open nor closed.

Note: I'm not sure if my solution is correct or not. Even I believe a disjoint union of closed and open sets cannot possibly be open nor closed (in Hausdorff spaces at least I believe...) but I recall that $\mathbb{A}^2$ is not Hausdorff, so I'm uncertain whether my intuition is correct.
Your solution is not correct: $V(x)\cup D(x)$ expresses $\Bbb A^2$ as a disjoint union of an open set and a closed set, but $\Bbb A^2$ is both open and closed in itself. So your claim about sets of this form being neither open nor closed is not true.

Here's a hint towards a correct solution: recall that any copy of $\Bbb A^1\subset \Bbb A^2$ has the subspace topology. So if $S$ is open (resp. closed), then $S\cap \Bbb A^1$ for any copy of $\Bbb A^1\subset \Bbb A^2$ will be an open (resp. closed) subset of $\Bbb A^1$. Do you see what to do from here?

Full solution (that the OP came to in the comments) under the spoiler:


   Consider the two lines $V(y)$ and $V(x-1)$ inside $\Bbb A^2$. Both have the subspace topology, so if $S$ were to be closed or open, the intersection of $S$ with either of these lines would need to be closed or open respectively. But $S\cap V(y)$ is just the origin inside that line, which is not open, and $S\cap V(x-1)$ is the complement of the origin inside that line, which is not closed. So $S$ is neither closed nor open.
I'm not sure if this is correct or answer your question, but if you think in $\mathbb{R}^2$ ($k=\mathbb{R}$)and take the complement of $S$, $\hat{S}=\left\lbrace (0,y)\in \mathbb{R}^2\ \mid\ y\neq 0\right\rbrace ,$ we can see that $\hat{S}$ is not open (doesn't contain any neighborhood of any point), neither closed (take the sequence $\left\lbrace(0,\frac{1}{n}))\right\rbrace_{n\in\mathbb{N}}$, which does not converge in $\hat{S}$ ). So $S$ is not open neither closed.