You have the basic idea, but you’re missing some crucial pieces. If $C$ is not connected, you can’t guarantee that your $A$ and $B$ are open in $X$; you can only guarantee that they are relatively open in $C$. Thus, you want to show that if $A$ and $B$ are disjoint, relatively open subsets of $C$ such that $C=A\cup B$, then one of $A$ and $B$ must be empty.
Since $A$ and $B$ are relatively open in $C$, there must be open sets $U$ and $V$ in $X$ such that $A=U\cap C$ and $B=V\cap C$. But then without loss of generality $U=X$ and $V=\varnothing$, so $B=\varnothing$, as desired and $C$ is connected.
Note that it makes no difference whether $C=X$ or not.