if $f(\frac{x+y}{2}) =\frac{f(x)+f(y)}{2}$ then find $|f(2)|$ if the following functional equation  $$f\bigg(\frac{x+y}{2}\bigg) =\frac{f(x)+f(y)}{2} \quad \text{ holds for all real }~ x  ~\text{ and }~ y$$  If$f'(0)$ exists and equals to $-1$ then find $|f(2)|$.
My work
I tried to find $f'(x)$ so that i can intregrate it and then find $f(x)$
$f'(x)=\lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$
which gave me this equation:
$f'(x)=\lim_{h \to 0} \frac{f(2x)-2f(x)+1+f(2h)-1}{2h}$
I could not proceed further
and the answer is $2$
If the brackets are not the greatest integer function, then, It's Jensen's Functional Equation and the solution is $f(x) = ax + b~$ for real $a~$ and $~b.$
Therefore from the given, we have
$$ f(0) = b = 0 ~\text{ and }~ f'(x) = a = - 1$$
Therefore the function is
$$ f(x) = -x \implies \lvert f(2)\rvert = 2 $$
$$f'(x) = -1$$
Integrate both sides
$$f(x) = -x $$
$$|f(2)| = 2 $$