Let $a_1, a_2, . . . , a_m$ be $m$ given real numbers.
(a) Prove that the mean of $a_1, a_2, . . . , a_m$ minimizes $(a_1−b)^2+ (a_2−b)^2+\dots+ (a_m−b)^2$ over all $b \in \mathbb R$ .
(b) Prove that a median of $a_1, a_2, . . . , a_m$ minimizes $|a_1−b|+|a_2−b|+\dots+|a_m−b|$ over all $b \in \mathbb R$.
Can theses problems be done using inequalities and not getting into calculus? Can anyone please give me some hints?

For (a) you have $$(a_1-b)^2+\cdots+(a_n-b)^2=A-2Mb+nb^2$$ where $A=a_1^2+\cdots+a_n^2$ and $M=a_1+\cdots+a_n$. You are minimising a quadratic function. Perhaps complete the square?