Doubt in problem on functions I'm stuck with a problem here, because i could not justify my way around a situation. 
THE PROBLEM
Let $f:R \to R$ be a function satisfying:
$|f(x+y) -f(x-y) -y| \le y^2$ for all $x,y \in R$. Then show that
$f(x) = \frac{x}{2} + c$ for some constant c
.
MY DOUBT
I started by putting $x=y$ which gives,
$|f(2x) - f(0) - x| \le x^2$
However, this eqn raised a doubt. Suppose $f(2x) = x^2 + c + x$ then the inequality willbeconverted into an equality,so the conditions are satisfied. But this is in direct contradiction with what we are asked to prove. Can someone please point out a mistake, because i coudnt find any when i tried?
 A: By letting $x=y$ you're only looking at a subset of the full collection of pairs $(x,y)$ for which the inequality is assumed. So that is criticism 1.
Also, there is no "right" to replace the $\le$ by $=.$ Or in other words, you have really just defined a function of $x$ alone, and noted that it satisfies the result of substituting $x=y$ in the original inequality.
What you really need to find is a function $f$ which satisfies the given inequality for all possible pairs $(x,y).$
Added: a proof. 
The assumed inequality is
$$|f(x+y)-f(x-y)-y|\le y^2 \tag{1}$$ for all real $x,y.$ Let $u=x+y,\ v=x-y$ so that $y=(u-v)/2.$ Now assume $u-v>0$ and divide $(1)$ by $u-v,$ to get
$$|(f(u)-f(v))/(u-v)-1/2|\le(u-v)/4. \tag{2}$$
If we now let $u \to v^+$ in $(2)$ we see that the right hand derivative of $f$ at the arbitrary real number $v$ exists and is $1/2.$ On the other hand if we let $v \to u^-$ in $(2)$ we see that the left hand derivative of $f$ at the arbitrary real number $u$ exists and is also $1/2.$
Since here each of $u,v$ are arbitrary, and both one-sided derivatives agree, we have that the (two sided) derivative of $f$ exists and is $1/2$ everywhere. Thus $f'(x)=1/2$ so that $f(x)=(1/2)x+c$ for some real $c$ as required.
A: Let $f(t)=\frac{t}2+g(t)$. Then the functional inequality can be rewritten as:
\begin{align}
&\left|\frac{x+y}{2}+g(x+y)-\left(\frac{x-y}{2}+g(x-y)\right)-y\right|\leq y^2\\
\implies&|g(x+y)-g(x-y)|\leq y^2.
\end{align}
Let $x-y=a$ and $2y = b$. Then, whenever $y\neq0$,
$$|g(a+b)-g(a)|\leq\frac{b^2}{4}\implies\left|\frac{g(a+b)-g(a)}{b}\right|\leq \frac{|b|}4.$$
Using this, what can you deduce about $g$ as $b\to 0$?
A: Your function satisfied your second equation, and the first one when $x=y$. But it doesn't satisfy the fist equation for all $x,y\in\mathbb R$, which is a stronger condition than the one with $x=y$
