I want to show:
Let $(X,\tau)$ be a topological space and $Y\subseteq X$. Then is $\overline{Y}$ closed.
For my proof I want to write $X\setminus\overline{Y}$ as union of open sets.
Sounds like a good approach!
Proof:
It is $\overline{Y}=Y\cup\partial Y$.
Consider $X\setminus(Y\cup\partial Y)=\overline{Y}^c$.
Here, I might instead say something like this: "By definition, $\overline Y=Y\cup\partial Y.$ We show that $X\setminus\overline Y$ is a union of open sets, so is open."
Let $x\in X\setminus(Y\cup\partial Y)$. Hence $x\notin Y$ and $x\notin\partial Y$.
Therefor for every neighborhood $U_x$ of $x$ it is $U_x\cap Y=\emptyset$.
This isn't quite right. Rather, by definition of $\partial Y,$ since $x\notin Y,$ then there exists a neighborhood $U_x$ of $x$ such that $U_x\cap Y=\emptyset.$
It's also a bit awkward, and there's a misspelling. I might say something like this: "Let $x\in X\setminus\overline Y.$ Since $\overline Y=Y\cup\partial Y,$ then by DeMorgan's Laws, $X\setminus\overline Y=(X\setminus Y)\cap(X\setminus\partial Y),$ so $x\notin Y$ and $x\notin\partial Y.$ Therefore, by definition of $\partial Y,$ there exists some neighborhood $U_x$ of $x$ such that $U_x\cap Y=\emptyset.$ Since $x\in X\setminus\overline Y$ was arbitrary, then such a $U_x$ exists for each such $x.$"
Hence $U_x\subseteq X\setminus Y$ and $\overline{Y}^c\subseteq\underbrace{\bigcup_{x\in\overline{Y}^c} U_x}_{\text{open}}\subseteq X\setminus Y$.
Nicely done! There's really no purpose to mentioning that the union is open right now, though. I'd wait until the end. (See what I do there.)
Now I want to show, that $\overline{Y}^c\supseteq\bigcup_{x\in\overline{Y}^c} U_x$.
Let $x'\in\bigcup_{x\in\overline{Y}^c} U_x$.
I have to show, that $x'\notin Y$ and $x'\notin\partial Y$.
You can certainly proceed in this way, though since $X\setminus\overline Y=(X\setminus Y)\cap(X\setminus\partial Y),$ and since you've already shown that $$X\setminus\overline{Y}\subseteq\bigcup_{x\in X\setminus\overline Y}U_x\subseteq X\setminus Y,$$ then you need only show that $$\bigcup_{x\in X\setminus\overline Y}U_x\subseteq X\setminus\partial Y,$$ meaning that you only have to show $x'\notin\partial Y.$
Since $x'\notin\bigcup_{x\in\overline{Y}^c} U_x\subseteq X\setminus Y$ is $x\notin Y$.
This doesn't make sense. It seems like you're trying to say that, since $x'\in\bigcup_{x\in X\setminus\overline Y}U_x\subseteq X\setminus Y,$ then $x'\notin Y.$ However, as I said, we don't even need to say this.
Suppose $x'\in\partial Y$.
That's what I'd do!
Then holds for every neighborhood $U_{x'}$ of $x'$, that $Y\cap U_{x'}\neq\emptyset$ and $U_{x'}\cap (X\setminus Y)\neq\emptyset$.
Which contradicts, that $U_{x'}\subseteq X\setminus Y$.
You've got the right idea, but it seems that you're trying to let $U_{x'}$ be simultaneously arbitrary and a specific counterexample. Instead, I'd say something like this: "By definition of $\partial Y,$ this means that for every neighborhood $U$ of $x',$ we have $U\cap Y\neq\emptyset.$ However, since $x'\in\bigcup_{x\in X\setminus\overline Y}U_x,$ then we have that $U_{x'}$ is a neighborhood of $x'$ disjoint from $Y,$ yielding the desired contradiction."
We condlude, that $\overline{Y}^c=\bigcup_{x\in\overline{Y}^c} U_x$ open.
Hence $\overline{Y}$ is closed.
Here, I'd just say (if you lead off as I did by announcing your intention) something like: "We conclude that $$X\setminus\overline Y\subseteq\bigcup_{x\in X\setminus\overline Y}U_x\subseteq(X\setminus Y)\cap(X\setminus\partial Y)=X\setminus\overline Y,$$ so that $X\setminus\overline Y=\bigcup_{x\in X\setminus\overline Y}U_x.$ As a union of the open sets $U_x,$ we have that $X\setminus\overline Y$ is open, as we set out to show."
Let me know if you have any questions about my answer, or if you just want to bounce your phrasing adjustments off somebody.
Best Answer
To show $K^c$ is open: Let $x\in K^c$. For each $y\in K$, let $U_y$ and $V_y$ be such that $x\in U_y, y\in V_y$ and $U_y\cap V_y=\emptyset$, by Hausdorffness. Now $\{V_y\}_{y\in K}$ is an open cover of $K$. Take a finite subcover, $V_{y_1},\dots, V_{y_n}$, by compactness. Then consider $U=U_{y_1}\cap U_{y_2} \dots \cap U_{y_n}$. It is easy to see that $U$ is a nbhd of $x$ with $U\subset K^c$. $\square $