I could do this if $A$ is an open set.
If $A$ is open, so is $A\cap X$ and $A\cap X^c$, and if we suppose $\{a,b\}\subseteq A$ we have that $A\cap X$ and $A\cap X ^c$ are non-empty and hence we have $A$ as a non-trivial disjoint union of open sets (so $A$ could not be connected).
But if $A$ isn't a open set I couldn't show it as a union of non-empty open sets.
Anyone could help me?
Presumably there is a parent space, $Y$ say, and the sets $A$ and $X$ are subsets of $Y$.
Since $A$ is connected, then as a topological space in its own right, $A$ is not the union of two nonempty disjoint open subsets (of itself).
The topology on $A$ is the relative topology, so your argument works as is, since the sets $A\cap X$ and $A\cap X^c$ are open in the relative topology on $A$.