I have to decide if it possible to find a set $A\subset \mathbb{R}$ such that:
$A$ is not connected nor compact but it is complete.
At first, I thought it wasn't possible, and made the following "proof":
Proof: Given that $A$ is not connected, it is possible to find $B$, $C$ subsets of $\mathbb{R}$, disjoint and open such that $A=B\cup C$. Using the "representation theorem for open sets on the real line" (math analysis, Apostol), $B$ and $C$ are both a countable union of disjoint open intervals, so $A=\bigcup_{k=1}^{\infty}(a_k,b_k)$ where one $a_j$ and $b_j$ can be $-\infty$ and $+\infty$, respectively.
So if we take one interval with a finite endpoint, say, $(a_2,b_2)$ ($a_2$ finite), we can construct a sequence converging to $a_2$, so that sequence is cauchy, but doesn't converge to a point belonging to $A$. $\blacksquare$
But a classmate could find an example: $\mathbb{Z}$. Another one: $\bigcup_{k=0}^{\infty}[2k,2k+1]$.
So, what's wrong with my proof? Any help is highly appreciated. Thanks and regards.
You need to be careful when you write $A$ as a disjoint union of sets. We have that $A = B\cup C$ where $B$ and $C$ are open in $A$, but they don't have to be open in $\mathbb{R}$. Consider $A = [0,1) \cup [2,3]$.
As a hint to finding a disconnected, noncompact, complete set, I would consider an interval of the form $(-\infty, a]$ for some $a \in \mathbb{R}$. There is a way to construct a set with the desired properties from an interval of this form.