Let $A$ be a convex and compact subset of $\mathbb{R}^2$ and consider some absolutely continuous $F:A\to \mathbb{R}$. Then $\nabla F$ exists almost everywhere on $A$. I want to show that $F$ is convex if its gradient is monotone wherever it exists.
That is, if for any $(x_1,y_1),(x_2,y_2)\in A$ where $\nabla F$ exists, we have: $$ [\nabla F(x_2,y_2) - \nabla F (x_1,y_1)] \cdot [(x_2,y_2) - (x_1,y_1)] \geq 0. $$
My attempt, following proof of Proposition 1.3 here
Fix $(x_1,y_1)$ and $(x_2,y_2)$ where the gradient exists. We can define $g(t):=F(x_1+t(x_2-x_1),y_1+t(y_2-y_1))$ so that $g(0)=F(x_1,y_1)$ and $g(1)=F(x_2,y_2)$. Then, the following holds wherever the gradient exists, so almost everywhere: $$ g'(t) = [\nabla F(x_1+t(x_2-x_1),y_1+t(y_2-y_1))] \cdot [(x_2,y_2) - (x_1,y_1)]\geq g'(0). $$ Now, since $F$ is absolutely continuous, we can write: $$ F(x_2,y_2)= g(1) = g(0) + \int_0^1g'(t)dt \geq g(0)+ \int_0^1g'(0)dt $$ $$ = \nabla F(x_1,y_1) \cdot [(x_2,y_2) - (x_1,y_1)] $$ Thus, $\nabla F(x,y)$ is a subgradient of $F(x,y)$ almost everywhere on $A$. Since $F$ is continuous, this means that a subgradient of $F$ exists everywhere and thus $F$ is convex (since a function on a convex set is convex iff it has a subgradinet everywhere on its domain).