I have to prove a intermediate-value-sentence for a continous function $f: R \rightarrow \mathbb{R}$, where R is either an open or closed rectangle in $\mathbb{R}^2$. We know further that $f: \mathbb{R}^n \rightarrow \mathbb{R}$ be continous and $a,b \in \mathbb{R}^n$ and $g: \mathbb{R} \rightarrow \mathbb{R}$ be continous where $g(t) = f(ta+(1-t)b)$
My TA has told me that my proof is correct but I cannot explain why a linear-combination will be in R. I have done the following:
Assume without loss of generality that $f(b) \leq f(a)$. We choose k such that $g(0) = f(b) \leq k \leq f(a) = g(1)$ when $a,b \in R$. We want to prove that $\exists l \in R$ such that $f(1) = k$. From the intermediate-value-sentence we know that $\exists l' \in [0,1]$ such that $g(l') = k$. Thus $$ g(l') = f(l'a(1-l')b) = k $$ which means that if $l = l'a(1-l')b$ we have $f(l) = k$ and we are done. But how do I prove that $l \in R$? I know that a rectangle can be written as a set $$ R = \{(x,y) \in \mathbb{R}^2 | \alpha \leq x \beta, \epsilon \leq y \leq \delta\} $$ where $\alpha, \beta, \delta, \epsilon \in R$
The same I have to do for either an open or closed ball which can be written as a set $$ D = \{x \in \mathbb{R}^n : ||x-c|| \leq r \} $$ where $c\in \mathbb{R}^n, r \in \mathbb{R}$ Here I do now know either how to explain that $k \in D$, where $k = k'a(1-k')b$