Let $f(x)=\max\{f_1(x), f_2(x)\}$ where $f_1$ and $f_2$ are differentiable convex functions defined on $R^n$. Let $x'$ be such that $f(x')=f_1(x')=f_2(x')$. Show that $g$ is a subgradient of f at $x'$ if and only if $$g=\lambda \nabla f_1(x')+(1-\lambda) \nabla f_2(x')$$ where $0\leq \lambda \leq1.$
The "if" part was pretty straight-forward, but as often I tend to struggle with the "only if" part. I thought of assuming that there exists a subgradient $g$ such that $g \notin conv(\nabla f_1(x'), \nabla f_2(x'))$ and using the theorem of hyperplane seperation, but so far I've had no luck.
In general I tend to struggle with proving that every subgradient has a particular form.