So I am searching to prove that if the Stone-Čech compactification $\beta X$ of a Tychonoff space $X$ is connected then $X$ is connected. Therefore, I tried to prove that $\beta[X]$ is connected and in particular I tried to procced as by reduction ad absurdum. So if $\beta[X]$ is not connected then there exist two disjoint set $A_1$ and $A_2$ of $\beta X$ such that $\beta[X]$ is disjoint union of $A_1\cap \beta[X]$ and $A_2\cap \beta[X]$. So I observed that $$ \beta[X]\subseteq A_1\cup A_2 $$ and thus I conclude that $A_1\cup A_2$ is dense so that $X$ is union of $\operatorname{cl}A_1$ and $\operatorname{cl}A_2$ but this does not seem help; moreover I observed that $$ (A_1\cap A_2)\cap\beta[X]=\emptyset $$ so that by density of $X$ I clonclude that $A_1$ and $A_2$ are disjoint and thus $$A_1\subseteq\beta X\setminus\operatorname{cl}A_2\quad\text{and}\quad A_2\subseteq\beta X\setminus\operatorname{cl} A_1 $$ and thus I conclude that $X$ is union of $X\setminus A_1$ and $X\setminus A_2$ so that $(X\setminus A_1)\cup (X\setminus A_2)$ is dense but another time this does not seem help.
Anyway, I know that a topological space $T$ is connected if and only if there not exists continuous function form $T$ to the discrete space $\{0,1\}$ so that I tried to define a function $$ f(x):=\begin{cases}0,\,\text{if }x\in A_1\cap\beta[X]\\ 1,\,\text{if }x\in A_2\cap\beta[X]\end{cases} $$ for any $x\in\beta[X]$ and thus I tried to extend it to a continuous function on $\beta X$ but I unfortunately failed: however here is said that this is a trivial fact but I really do not see this.
Finally, I tried to use the following hint given by my topology text.
Hint: the clousure of a clopen set on $\beta[X]$ is clopen in $\beta X$.
However I was not able to use this hint and thus I thought to put a specific question. So could someone help me, please?
A much less sophisticated argument: