If $f(\frac{x+y}{2})=\frac{f(x)+f(y)}{2}$, then find $f(2)$ Let $f(\frac{x+y}{2})=\frac{f(x)+f(y)}{2}$ and it is given that 
$f(0)=1$ and $f'(0)=-1$, where $f'$ denotes first derivative. Find the value of $f(2)$
Could someone tell me how to use $f'(0)=-1$ here? I am not able to use this information.
 A: If $f$ satisfies your equation, then $g(x) = f(x) - f(0)$ satisfies the Cauchy functional equation $g(x+y) = g(x) + g(y)$.  Of course, if $f'(0)$ exists, then $g$ is continuous.  The only continuous solutions of the Cauchy functional equation are the linear functions $g(x) = ax$, so the only continuous solutions of your equation are the affine functions $f(x) = a x + b$.  The rest is easy. 
A: Let $y=0$ to turn the equation one with one parameter $x$. Then differentiate both sides through implicit differentiation and you will see that:
$$f'(\frac{x}{2})=f'(x)$$
Now here https://math.stackexchange.com/a/1800067 @Eric Wosfey answers about this equation with $f'(0)=-1$:
I will assume that $f:\mathbb{R}\to\mathbb{R}$ is supposed to be $C^1$, so $f'$ exists and is continuous everywhere.  Now note that for any $x\in \mathbb{R}$, $f'(x)=f'(x/2)=f'(x/4)=f'(x/8)=\dots$.  But $x/2^n$ converges to $0$ as $n\to\infty$, so continuity of $f'$ now implies $$-1=f'(0)=\lim_{n\to \infty}f'(x/2^n)=f'(x).$$  So $f'(x)=-1$ for all $x$, and thus $f(x)=-x+C$ for some constant $C$.
So from his answer we see that:
$$f(x)=-x+c$$
It is given that $f(0)=1$, so substituting this in we get:
$$f(0)=c=1$$
So
$$f(x)=1-x$$
And finally,
$$f(2)=1-2=-1$$
Edit:
It may not seem clear that,
$$f'(x)=f'(x/2)=f'(x/4)=f'(x/8)...$$
But this stems from the fact we can substitute $x=u/2$ into our original equation to get:
$$f'(u/2)=f'(u/4)$$
$$f'(x/2)=f'(x/4)$$
Now substitute $x=u/2$ again and again while switching the dummy variable $u$ back to $x$  to get the result so essential in his proof.
A: Equality $f(\frac{x+y}{2})=\frac{f(x)+f(y)}{2}$ is only possible for affine functions, with equation 
$$f(x)=ax+b \ \ \ \ (1)$$
(see explanation below)
When you impose conditions $f(0)=1$ and $f'(0)=-1$, one obtains $b=1$ and $a=-1$. Thus equation (1) becomes $f(x)=-x+1$. Therefore $f(2)=-1.$
Explanation: 


*

*$f(\frac{x+y}{2})\leq\frac{f(x)+f(y)}{2}$ characterizes convex functions (i.e., whose curve is above any of their tangents), 

*$f(\frac{x+y}{2})\geq\frac{f(x)+f(y)}{2}$ characterizes concave functions  (i.e., whose curve is under any of their tangents). 
In view of that, the only functions that are both convex and concave are the affine functions.
