Consider the continuous, non-decreasing function $$\beta:\mathbb{R} \rightarrow \mathbb{R},$$ where $\beta(0)=0.$
Define $$g(s)=\int_0^s \beta(u)du,$$ where $s$ is a positive constant.
Let now $A=\{w \in W^{1,p}(]0,r[), w(0)=0, w(r)=q \},$
where $r$, $q>0.$
Define $$J:A \rightarrow \mathbb{R}$$ as $$J(w)=\int_0^r g(w(t))dt, ~~ \mbox{for all}~ w \in A.$$
My question is, how to prove that $J$ is a convex function? I really tried but with no result.
My trial:
For $\lambda \in [0,1]$, $w_1$, $w_2$ $\in A$, we have
$$J(\lambda w_1+(1-\lambda)w_2)=\int_0^r g(\lambda w_1(t)+(1-\lambda)w_2(t))dt,$$
with $$g(\lambda w_1(t)+(1-\lambda)w_2(t))=\int_0^{\lambda w_1(t)+(1-\lambda)w_2(t)}\beta(u)du,$$ and stuck here.
I need please a continuation to my answer, or a logical answer. Many thanks.