Question: Let $n\in\mathbb{N}.$ Suppose that $O\subseteq \mathbb{R}^n$ is an open connected subset. Is it true that for every $x,y\in O, x\neq y,$ there exists an infinite compact subset $K$ of $O$ such that $x,y\in K?$
My attempt: Since $x\neq y,$ by Hausdorfness of $\mathbb{R}^n,$ there exist two disjoint open neighbourhoods $U$ and $V$ of $x$ and $y$ respectively. We can assume both $U$ and $V$ are bounded. Then there exists closed subsets $A\subseteq U$ and $B\subseteq V$ that contain $x$ and $y$ respectively. Let $K = A\cup B.$ Then $K$ is a compact subset of $O$ such that $x,y\in K.$
Is my proof correct?
Since $O$ is connected, for any $x,y \in O$, we can find a path $\gamma : [0,1] \to O$ that is continuos from $x$ to $y$, and the image of this path contains both $x$ and $y$, which is compact since $[0,1]$ is compact and $\gamma$ is continuos.
Hence take $K := \gamma ([0,1])$.
About your proof, I think it is quite OK.
Actually, the question would be much more interesting if it was asking a compact and connected subset $K$ of $\mathbb{R}^n$.