# Continuous extension of a function to the Stone-Cech compactification

Let $$C(X)$$ be the set of all continuous, real-valued functions on a Tychonoff (completely regular) topological space $$X$$ and let $$\beta X$$ be the Stone-Cech compactification of $$X$$. Now let $$f\in C(X)$$ such that $$f(X)=\{0, 1\}$$ and $$f^\beta$$ be an extension of $$f$$ to $$\beta X$$, that is, $$f^\beta\in C(\beta X)$$. How can we show that $$f^\beta(\beta X)=\{0, 1\}$$?

The Stone-Čech compactification has a very strong property: if $$f\colon X\to Y$$ is a continuous map with $$Y$$ compact, then $$f$$ can be (uniquely) extended to $$\beta f\colon\beta X\to Y$$. See Universal property and functoriality on Wikipedia.
Since $$\{0,1\}$$ is compact, you're done.
$$X$$ is dense in $$\beta(X)$$. Hence $$f^{\beta} (\beta(X)) = f^{\beta} (\overline {X})$$ which is contained in the closure of $$\{0,1\}$$ (by continuity) so it is contained in $$\{0,1\}$$. Reverse inclusion follows by the fact that $$f^{\beta}$$ extends $$f$$.