I am curious about this problem: Let $X$ be a topological space. If every $Y\subseteq X$ is a discrete space whenever $Y$ is compact, then is it true that $X$ is Hausdorff?
My attempt: let $x,y\in X$. We consider 2 cases
(i) there is $Y\subseteq X$ such that $x,y\in Y$. Since $Y$ is compact and discrete, $\{x\}, \{y\}$ are open in $Y$. So, there are two open sets $A$ and $B$ in $X$ such that $\{x\}=A\cap Y$ and $\{y\}=B\cap Y$. Since $$(A\cap B)\cap Y=\emptyset,$$ we have $A\cap B=\emptyset$. We deduce $X$ is Hausdorff.
(ii)there are $Y, Z\subseteq X$ such that $x\in Y$ and $y\in Z$. Since $Y,Z$ are compact and discrete, $\{x\}, \{y\}$ are open in $Y$ and $Z$, respectively. There are open sets $A$ and $B$ in $X$ such that $\{x\}=A\cap Y$ and $\{y\}=B\cap Y$. Since $$(A\cap B)\cap (Y\cap Z)=\emptyset,$$ we have $A\cap B=\emptyset$. We deduce $X$ is Hausdorff.
Your argument in case (i) doesn't quite work: you cannot conclude from $A\cap B\cap Y=\emptyset$ that $A\cap B=\emptyset$; they might intersect at points outside of $Y$.
In case (ii), there is a similar issue. In fact, in case (ii), nothing would prevent you from taking $Y=\{x\}$ and $Z=\{y\}$, in which case your argument (if it worked) would prove that every space is Hausdorff. However, case (ii) is never actually necessary. For any $x,y\in X$, the subspace $Y=\{x,y\}\subseteq X$ is compact (since any finite space is compact).
Your proof aside, it turns out that the result you are trying to prove is not true! As a counterexample, consider the case where $X$ is an uncountable set with the cocountable topology.