I am revisiting a book and came across the following problem:
Let $$\begin{align*} f(\boldsymbol{x}) = \sum_{i=1}^{r} |x|_{[i]} \end{align*}$$ where $\vert x \vert_{[i]}$ is the $i$ th largest component of $|x_1|, \cdots, |x_n|$. Is $f$ convex?
I have been attempting to do this for hours using the second-order condition of convexity ($\nabla^2 f(x) \ge 0$) as well as trying to approach it as a set and prove the convexity of a set.
The fact it is a sum is completely throwing me off. Would appreciate some help with this. Thank you.