I have been asked to prove the following:
Let $X$ be a connected topological space, let $p\in X$, and let $X-\{p\}$ be disconnected. Prove that $\{p\}$ must be either open or closed in $X$, but cannot be both open and closed in $X$.
I understand that $\{p\}$ cannot be both open and closed in $X$ as this would imply that $\{p\}$ and $X-\{p\}$ are both open in $X$, which implies that $(X-\{p\}) \cup\{p\}=X$ is disconnected, as it is the union of two open disjoint sets.
So far I have been unable to establish why the case of $\{p\}$ being neither closed nor open is untenable. If you have any input or suggestions, it would, as always, be greatly appreciated.
Since $X\setminus\{p\}$ is disconnected, there are open non-empty subsets $A$ and $B$ of $X\setminus\{p\}$ whose intersection is empty and whose union is $X\setminus\{p\}$. Since $A$ and $B$ are open subsets of $X\setminus\{p\}$, there are open subsets $A^\star$ and $B^\star$ of $X$ such that $A=A^\star\cap(X\setminus\{p\})$ and that $B=B^\star\cap(X\setminus\{p\})$. Now, there are $4$ possibilities: