Show that a subset $I$ of $\textbf{R}$ is an interval if and only if whenever $a,b\in I$ and $0\leq t\leq 1$ then $(1-t)a + tb\in I$. Show that a subset $I$ of $\textbf{R}$ is an interval if and only if whenever $a,b\in I$ and $0\leq t\leq 1$ then $(1-t)a + tb\in I$.
MY ATTEMPT
We say that a subset $I$ of $\textbf{R}$ is an interval iff $a \leq c \leq b$ and $a,b\in I$ implies that $c\in I$. Based on such definition, we may proceed.
Let us prove the implication $(\Rightarrow)$ first.
Suppose that $I$ is an interval and $a,b\in I$ s.t. $a \leq x \leq b$.
We shall prove that $(1-t)a + tb\in I$ whenever $t\in[0,1]$.
In order to do so, let us consider that $t = (x-a)/(b-a)\in[0,1]$.
We have that $t\in[0,1]$ because $a\leq x\leq b$. Moreover, we do also have that
\begin{align*}
x = a + x - a = a + (b-a)\times\frac{x-a}{b-a} = a + (b-a)t = (1-t)a+ bt\in I 
\end{align*}
Conversely, let us prove the implication $(\Leftarrow)$.
Let us suppose that $a,b\in I$ and $(1-t)a + tb\in I$ whenever $t\in[0,1]$.
Thus, if $a\leq x\leq b$, we have
\begin{align*}
t = \frac{x-a}{b-a}\in[0,1]\Rightarrow (1-t)a + bt = a + t(b-a) = a + \frac{x-a}{b-a}\times(b-a) = a + x - a = x \in I
\end{align*}
and we are done.
Could someone please check if the wording of my proof is correct?
Any contribution is appreciated.
 A: The issue with your approach has been described in comments to your question, but for completeness sake let us put it here also. You are supposed to show that for every $t\in[0,1]$ the number $(1-t)a+tb$ lies in interval $[a, b] $. But then you take up $t$ in some specific form $t=(x-a) /b-a$. And you write that $t\in[0,1]$ because $a\leq x\leq b$. Well, you had to prove the other way round that if $t\in[0,1]$ then $x\in[a, b] $.
Just do it directly. Let $t\in [0,1]$ and we need to show $$(1-t)a+tb\geq a$$ ie $$tb\geq a-(1-t)a=ta$$ which clearly holds if $t=0$ and if $t>0$ this is equivalent to $b\geq a$ which is already part of hypothesis. And thus we have shown $$(1-t)a+tb\geq a$$ Next we also need to show $$(1-t)a+tb\leq b$$ or $$(1-t)a\leq (1-t)b$$ Clearly this holds for $t=1$ and if $0\leq t <1$ then we can see (via dividing by positive number $1-t$) that it is equivalent to $a\leq b$ which is already given. This completes the proof of first part.
For the second part let us assume that for every $t\in[0,1]$ the number $(1-t)a+bt\in I$. If $a\leq c\leq b$ then we can write $$c=(1-t) a+tb$$ where $t=(c-a) /(b-a) $. Clearly $$0\leq c-a\leq b-a$$ and hence $0\leq t\leq 1$ and then by our assumption $c=(1-t)a+tb\in I$ and therefore $I$ is an interval. Also note that if $a=b$ then this has to be handled specially.
