Let $A\in \mathbb{R}$ and $A>0$, $\alpha \in \mathbb{R}$, and $u,f \in C([0,A])$.
Suppose that for every $g \in C^\infty((0,A))$ we have $$g'(x_0) + \alpha u(x_0) \le f(x_0)$$ if $x_0$ is a local maximum of $u-g$.
How can I prove that $$e^{\alpha x}u(x) \le e^{\alpha y}u(y) + \int_y^x e^{\alpha \xi} f(\xi) d\xi$$ for any $x,y \in [0,A]?$
My failed attempts were mostly manipulations that included integrations by parts and several attempts at reasoning by contradiction.
The function $u$ is a subsolution of the differential equation $v^{\prime }+\alpha v=f$ in the viscosity sense. I'll use standard tricks for viscosity solutions. Assume that $\alpha>0$. Fix $y\in\lbrack0,A]$. A solution of this differential equation is given by $$ g(x)=e^{-\alpha(x-y)}u(y)+e^{-\alpha x}\int_{y}^{x}e^{\alpha t}f(t)\,dt,\quad x\in\lbrack0,A]. $$ We claim that $u(x)\leq g(x)$ for every $x\in(y,A)$. If not, then there is $x_{1}\in(y,A)$ such that $u(x_{1})>g(x_{1})$. Let $x_{0}\in(y,A]$ be the point of absolute maximum of $u-g$. We consider two cases:
To see that $x_{\varepsilon}\rightarrow A$, assume by contradiction that for a subsequence (not relabelled) $x_{\varepsilon}\rightarrow x_{0}$ as $\varepsilon\rightarrow0^{+}$ with $x_{0}\neq A$ (note that $[y,A]$ is compact). But for every $x\in\lbrack y,A]$ since $x_{\varepsilon}$ is a point of maximum, $$ u(x)-g_{\varepsilon}(x)\leq u(x)-g_{\varepsilon}(x_{\varepsilon}% )=u(x)-g(x_{\varepsilon})-\frac{\varepsilon}{A-x_{\varepsilon}}\leq u(x)-g(x_{\varepsilon}). $$ Letting $\varepsilon\rightarrow0$ it follows that% $$ u(x)-g(x)\leq u(x_{0})-g(x_{0}). $$ But since $A$ is a point of strict maximum, necessarily $x_{0}=A$. Thus, we have shown that when $\alpha>0$, $u(x)\leq g(x)$ for every $x\in(y,A)$. With a similar proof you can show that $u(x)\leq g(x)$ for every $x\in(0,y)$.
Not sure what to do for $\alpha<0$. Similar tricks, I assume.