I have looked up solutions to this when it was asked in Rudin, but the solutions don't really make sense to me, because they use a previous question that Rudin asked as part of the solution. I just want to prove this theorem on its own through connectedness.
The outline of my proof is: if we assume that set E is separated by two sets $A$ and $B$, we let $x\in A$ and $y \in B$. So because it's convex, $\lambda x + (1-\lambda) y \in E$ when $x\in E$, $y \in E$, and $0 < \lambda < 1$. So the set (0,1) is connected in $\mathbb{R}^1$. I'm not really sure where to go from here.
Each two points $x,y$ of a convex set are connected via the path $\alpha x+(1-\alpha)y$.