Let $f:\mathbb{R}^p \rightarrow \mathbb{R}$ be a linear transformation i.e $f(x) = a\cdot x$ with $a=(a_1,...,a_p) \in \mathbb{R}^p$. Prove: if $K=\{ x \in R^p : \|x\| \leq 1\}$ then $f(K) =[-M,M]$ where $M= \|a\|$.
I was able to prove $f(K)$ is in the interval, but not the other way around. I know that $f(K)$ is compact since $K$ is compact and $f$ continuous, but I am stuck there.
Note: I should not use connectedness to solve the problem.
Note that $|f(x)|=|a\cdot x| \le \|a\| \cdot \|x\|$ by Cauchy-Schwarz and it achieves equality iff $x$ and $a$ are parallel. Thus $|f(x)| \le \|a\|$ for all $\|x\| \le 1$, and $f(a/\|a\|) = \|a\|.$ Thus $f(K) \subset [-M,M]$.
From the previous paragraph, $M = \|a\| \in f(K)$. Note also $f(-a/\|a\|) = -\|a\| = -M$. Thus $-M \in f(K)$. Now for $\lambda \in [-1,1]$ consider $$f\left( \lambda \cdot \frac{a}{\|a\|}\right) = \lambda \cdot f\left(\frac{a}{\|a\|}\right) = \lambda M.$$