This question is motivated from GRE math subject test.
Let $f$ and $g$ be functions of a real variable such that for all $x$, $$g(x)=\int\limits_{0}^{x}f(y)(y-x)\,\mathrm{d}y\,.$$ If $g$ is three times continuously differentiable what is the greatest integer $n$ for which $f$ must be $n$ times continuously differentiable?
$$ \text{(a) } 1\quad\text{(b) } 2\quad\text{(c) } 3\quad\text{(d) } 4\quad\text{(e) } 5$$
What I thought is to try differentiating the function. By the fundamental theorem of calculus I thought that $\mathrm{d}g/\mathrm{d}x$ should be $f(x)(x-x)=0$ which I guess is wrong so I figured that FTC must not work for multi-variable functions. So I have no idea what to do. Does anyone have any ideas?
Thanks in advance