On the page $214$, in Proposition 21.6 of this book how is $Y$ Hausdorff?
Let $X$ be a set, $\beta X$ be a Stone space of $2^X$ and $\beta:X\to \beta X$ the homeomorphic embedding. If $Y$ is compact and $f:X\to Y$ is continuous then there is a unique continuous extension of $f$ to $\beta X$, $g:\beta X \to Y$ such that $f=g\circ \beta$
The Stone space here means sets of the form $\{A\subset X:x\in A\}$ for $x\in X$ (much like Stone-Cech compactification of $\mathbb{N}$). In the middle of proof author says that $Y$ is a Hausdorff, but it's not assumed in proposition. So I was confused how one could deduce $Y$ is Hausdorff. In fact doesn't $Y=\{0,1\}$ with indiscrete topology and $f:\mathbb{N}\to \{0\}$ gives a counterexample?
For the existence of $g$ we do not need Hausdorffness of $Y$, we do for the unicity. In your example with $Y$ a two-point indiscrete space, we can define define $g$ on $\beta X$ however we like as long as $g(\beta(n))= 0$ for all $n$, to obey the final condition and $Y$ being indiscrete means any map into it will be continuous. There are many different such $g$.
If $Y$ is assumed to be Hausdorff then as $g$ is determined on $\beta[X]$ by the condition $g \circ \beta = f$ and $\beta[X]$ is dense in $\beta X$, $g$ is fixed on a dense subset so uniquely determined by standard facts on Hausdorff spaces.