$\emptyset$ and $\mathbb{R}^n$ are the only clopen subsets of $\mathbb{R^n}$; $[\boldsymbol{x,y}]$:={$(1-t)\boldsymbol{x}+t\boldsymbol{y}:t\in[0,1]$} I am preparing for my exam and therefore practicing by solving some excercises. I need help for the following task:

Prove that the only clopen subsets of $\mathbb{R^n}$ are $\emptyset$ and $\mathbb{R^n}$.

I know that you can find a lot of posts here where people tried to solve this task. But I want to do this with help of the hint our teacher gave us.
Hint: Assume, there is a nonempty proper subset S of $\mathbb{R^n}$, that is open and closed. Therefore, there exist $x\in S$ and $y\in S^c$. Where are the points on the connection route (hope this is the right english term) $[\boldsymbol{x,y}]$:={$(1-t)\boldsymbol{x}+t\boldsymbol{y}:t\in[0,1]$}?
I googled the term and found out that it has something to do with connected space/path connectedness. The problem is, that we never discussed this topic and thats why I don't know how to use the hint and where to start.
Is there anyone who can help me out? I would be grateful for any advice.
Edit: Here is my attempt:
Let's say: $t_0$=$\sup${$t\in[0,1]: (1-t)x+ty \in S$}. We are assuming that S is closed and open. Since S is closed, $t_0$$\neq 1$. If $t_0=1$ y would be in S but it isnt. So $0\leq t_0<1$. Also since S is closed, $((1-t_0)x+t_0y)$$\in$S. This means $((1-t)x+y)\in S^c$ for $t\in (t_0,1]$.This would mean that we would have infinite many t next to the limit $t_0$, with the consequence that $((1-t)x+ty)\in S^c$. This would mean, that $S^c$ is not closed. But we assumed that S is open too, there $S^c$ has to be closed too. A contradiction.
 A: Hint
Let $\ t^*=\sup\big\{t\in[0,1]\,|\,(1-t)x+ty\in S\big\}\ $.  Is $ \big(1-t^*\big)x+t^*y\ $ in $\ S^c\ $? Is it in $\ S\ $?
Thanks to FShrike for pointing out that answering the original version of these questions wouldn't have been of any help.
A: (You also have to assume that $S$ is neither empty, nor $\mathbf{R}^n$, and then find a contradiction.)
You won't need to use (path-)connectedness to prove this using the hint. Have you proven it for $\mathbf{R}^1$ already? Really all you have to do is use a similar argument, but not on a interval of $\mathbf{R}$ but on that line. The idea is to use supremum property of $\mathbf{R}$ and let $t_0 = \sup ...$
A: Not an answer, just a response to the comments which was too long to leave as a comment itself. This is to supplement Ionza's hint and to respond to the OP's attempt, based on this hint, in the comments below that post.
For clarity, let's parametrise the line connecting $x$ and $y$ as $\gamma:[0,1]\to\Bbb R^n,\,t\mapsto(1-t)x+ty$. We can rephrase $t^\ast$ from Ionza's post as $t^\ast=\sup_{0\le t\le 1}\{t:\gamma(t)\in S\}$

If $t^\ast=1$, then this implies any interval $(t',1]$ will contain infinitely many $t$ such that $\gamma(t)\in S$. Notice however that $\gamma(t^\ast)=\gamma(1)=y\notin S$ as $y\in S^c$. Consider that $S$ closed implies $S^c$ is open. Thus, there is an open neighbourhood of $y$ which is completely contained in $S^c$.
In your comment, you tried to say that "$S^c$  open" contradicts "$S^c$ closed". This is not generally true, and your argument for $S^c$ open doesn't quite work. I'll provide an example for the special $t^\ast=1$ case, you try and handle the cases $0\le t^\ast\lt1$ (the argument is similar).
Anyway, consider this open ball about $y$. It will contain, by basic geometry of the ball, a connected line segment of $\gamma$, i.e. there is some $0\lt t'\lt 1$ such that $\{\gamma(t):t\in(t',1]\}\subseteq S^c$. However, as remarked at the start, there are infinitely many such $t$ for which $\gamma(t)\in S$, and $S\cap S^c=\emptyset$, contradicting the above claim. Therefore $S^c$ cannot be open at $y$, so it cannot be in general open, so $S$ cannot be closed. This is a contradiction.

For the cases $0\le t^\ast\lt1$, I will say only that "$S$ closed" implies something about where $\gamma(t^\ast)$ is (Ionza's original hint) and you want to obtain a similar contradiction involving openness.
A: You just have to show that if $s$ is any proper non empty subset of $\mathbb R^n$ then  it cannot be open and closed simultaneously
