Example of continuous function over $\mathbb R^n$ Let $f:[0,1]\to\mathbb R^n$ such that $f(t)=ty+(1-t)x$ for some $x,y \in \mathbb R^n$. Prove that $f$ is continuous.
I know a definition that 
A function $f\colon X \rightarrow Y$
between two topological spaces $X$ and $Y$ is continuous if for every open set $V \subset Y$, the inverse image $f^{-1}(V) = \{x \in X \; | \; f(x) \in V \}$
is an open subset of $X.$
However I don't know how to apply the definition to solve the problem. Any help would be appreciated.
 A: If $x = y$, then $f(t) = x$ for all $t\in [0,1]$. Hence, for any open subset $V$ of $\Bbb R^n$, $f^{-1}(V)$ is either $[0,1]$ or $\emptyset$ (depending on whether $x\in V$ or $x\notin V$), both of which are open in $[0,1]$. So $f$ is continuous.
Now suppose $x\neq y$. Let $V$ be an open subset of $\Bbb R^n$. Given $t\in f^{-1}(V)$, there exists (by openness of $V$) an $\varepsilon > 0$ such that $B_\varepsilon(f(t)) \subseteq V$. Set $\delta = \frac{\varepsilon}{\|x - y\|}$. Then $f(B_\delta(t)\cap [0,1]) \subseteq B_\varepsilon(f(t))$. Indeed, given $u = f(s) \in f(B_\delta(t)\cap[0,1])$, 
$$|f(t) - u| = \|(s - t)(x -y)\|= |s - t|\|x - y\| < \frac{\varepsilon}{\|x - y\|}\|x - y\| = \varepsilon.$$ 
Hence $B_\delta(t) \cap[0,1]\subseteq f^{-1}(B_\varepsilon(f(t))) \subseteq f^{-1}(V)$, showing that $f^{-1}(V)$ is open in $[0,1]$. Since $V$ was arbitrary, $f$ is continuous.
A: It seems that you are looking at the function
$$f:\quad[0,1]\to{\mathbb R}^n, \qquad t\mapsto (1-t)x+ty$$
for given and fixed $x$, $y\in{\mathbb R}^n$. Since for arbitrary $t$, $t'\in[0,1]$ one has
$$f(t)-f(t')=(t-t')(y-x)$$
it follows that
$$\bigl\|f(t)-f(t')\bigr\|\leq \|y-x\|\>|t-t'|\ .$$
This proves that $f$ is even Lipschitz continuous on $[0,1]$.
