Difficult Analysis/Calculus Problem Involving FTC

1. The problem statement, all variables and given/known data
Find all continuous functions f: R -> R such that for all real x and all natural numbers n we have
(n^2)*integral[x to x + 1/n of f(t)dt] = n*f(x) + 1/2

2. Relevant equations
Mean Value Theorem

3. The attempt at a solution
Suppose a solution exists. Note that the LHS is differentiable according to the FTC. Hence, the RHS is differentiable (in particular, f is differentiable). We can rewrite the LHS as n^2{ integral[0 to x + 1/n of f(t)dt] - integral[0 to x of f(t)dt] }. Then differentiating both sides of the equation gives n^2[f(x + 1/n) - f(x)]= n*f'(x) or n[f(x + 1/n) - f(x)]= f'(x) for all x and all n. But this is the same as saying that there exists an x in (x, x+1/n) such that f'(x) = [f(x + 1/n) - f(x)] / (1/n) by the Mean Value Theorem.

Unfortunately, I am not sure how to proceed from here. It seems like the "calculus portion" is done but I can't see what kind of analysis I should be doing to finish the problem.

 PhysOrg.com science news on PhysOrg.com >> 'Whodunnit' of Irish potato famine solved>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change>> Curiosity Mars rover drills second rock target
 Recognitions: Homework Help Science Advisor Careful, you are using too many x's. Try writing it as "there is a c in (x,x+1/n) such that f'(c)=f'(x)". Since the difference quotient exactly equals f'(x). What does that suggest about the function f'?
 Ah thanks for the tip and the hint. So basically if the difference quotient is equal to f'(x), we should guess that the function is linear. Proving that the function is actually linear requires a few more steps. One way to do so is to notice that we can actually differentiate n[f(x + 1/n) - f(x)]= f'(x) again to get n[f'(x + 1/n) - f'(x)]= f''(x). Now f'' is continuous because f' is continuous from the previous equality. Now using Dick's hint, the mean value theorem gives a point c_n in (x, x + 1/n) such that f'(c_n) = f'(x). Take x and c_n to be endpoints of a closed interval and note that by Rolle's theorem, there is a point a_n in (x, c_n) with f''(a_n) = 0. As n -> infinity, a_n -> x and since f'' is continuous at x, f''(x) = lim(n -> infinity of f''(a_n) ) = 0 (first equality is due to a theorem allowing us to "pass sequences through continuous functions" and the second inequality is from the equation we derived for f''(x)). Since x could have been any real number, we find that f''(x) = 0 implying that f(x) = bx + d. Substituting this into the very first equation, we get b = 1 so f(x) = x + d for some constant d.