This is an exercise for the reader from my optimization course. A simple profit-model is $$\max_x p\cdot q(x) - c^Tx\quad\text{ s.t. }\quad x\ge 0$$ for some price $p$, costs $c$ and a continuous function $q:\mathbb R^n\rightarrow \mathbb R$. Now for fixed $c>0$ and an arbitrary continuous function $q$, denote the solution of the problem by $x(p)$ (we may assume it exists). Show that the function $$g(p)=p\cdot q(x(p))-c^Tx(p)$$ of the optimum payoff for given price $p$ is convex on $(0,\infty)$.
Since $q$ is not assumed to be differentiable, I don't think calculus can be used. On the other hand, if I work with $g(\lambda p_1+(1-\lambda)p_2)$, I don't know what to do with$x(\lambda p_1+(1-\lambda)p_2)$.
Is there some relationship/property of $x(p)$ that I'm missing here that would allow me to do a direct convexity proof? Or is there an indirect way to show that $g$ is convex?
$$g(p) = \max_{x : x\ge 0} \{ p\cdot q(x) - c^Tx\}$$ For fixed $x$, $p\cdot q(x) - c^Tx$ is affine in $p$, so $g$ is the maximum of a collection of convex functions, and is therefore convex on $\mathbb{R}$.
Note that it is not relevant that $q$ is continuous, that $c>0$ or that $x(p)$ is unique.