Suppose $f(a)$ $\le$ $g(a)$ and $f'(x)$ $\gt$ $g'(x)$ for all $x\in(-\infty, a]$ ($a$ is a real number) then $f(x)$ < $g(x)$ for all $x<a$.
So I know the claim is true, I defined a new function $h(x) = f(x) - g(x)$ and I'm stuck at the part where I get $f(x) -g(x) < f(a)-g(a)$ because I'm done if $f(a)-g(a) = 0$ but what about the part when it's smaller than $0$?
Thanks in advance!
Your question can be rephrased as
Apply the Mean Value Theorem on $h$ to solve this question: for all $x<a$, there exists $c \in (x,a)$ such that $$\frac{h(x)-h(a)}{x-a} = h'(c) > 0.$$ The inequality is reversed when we multiply both sides by $x-a<0$. This gives $h(x)<h(a)\le0$ for all $x<a$, so $f(x) < g(x)$ for all $x<a$. Q.E.D.