TITLE: Prove that $f(x) = a g(x)$
QUESTION [6 upvotes]: Given  two functions $f,g: \mathbb R \to \mathbb R $ such that 

$g(x) \neq 0 \; \forall x \in \mathbb R$ 
$f''(x)g(x) = f(x)g''(x) \; \forall x \in \mathbb R$
$f(0)g'(0) = f'(0)g(0)$

Prove that $f(x) =  ag(x), \; a \in \mathbb R$ 
My thought:
Let $h(x) = f(x)/g(x)$ and try to prove that $h(x)=a$. This function $h: \mathbb R \to \mathbb R$ is twice differentiable with 
$$h' = (f/g)' = (f'g-g'f)/g^2 $$ and $$h '' = \frac {-2g'h'} {g} = -2h' (\ln |g|)'$$
I want to prove that $h'' = 0 $ given the above.

REPLY [9 votes]: Adding $f'g'$ to both sides of $(2)$ and integrating with initial condition $(3)$ we get $f'g=fg'$. Then $(f/g)'=0$ and result follows.
EDIT: Sorry for the terse answer above. Here's a more detailed one:
$$f''g=fg''\implies f''g+f'g'=f'g'+fg''\implies (f'g)'=(fg')'$$
Integrating, $f'g = fg'+c$. Using initial condition, $c=0$. Now
$$\left(\frac{f}{g}\right)' = \frac{f'g-fg'}{g^2}=0\implies f=ag$$
for some $a\in\mathbb{R}$.