We have a functional equation with two variables, say $x$ and $y$. Our goal is to find $f'(x)$. I treated $y$ as a constant and differentiated. But then I had to take $y$ in terms of $x$ to find $f'(x)$. Can I do so, since I have treated $y$ as a constant initially and then wrote it in terms of $x$?
Example:
$f \left(\frac {x+y} 2 \right)=\frac {f(x)+f(y)} 2$ and $f'(0)=-1$.
Treating $y$ as constant,
$f'\left(\frac {x+y} 2\right)=f'(x)$.
Substituting $0$ for $x$ and $2x$ for $y$,
$f'(x)=f'(0)=-1$.
Edit: This question is a part of another question, where it is asked to find $f(x)$. We can do so once we obtain $f'(x)$
Maybe it would help you if you thought about it this way.
Take any $ y $ and define the function $ g _ y $ with
$$ g _ y ( x ) = f \left( \frac { x + y } 2 \right) - \frac { f ( x ) + f ( y ) } 2 \text . \tag 0 \label 0 $$
So now we have many many functions; $ g _ 0 $ is a function satisfying $ g _ 0 ( x ) = f \left( \frac x 2 \right) - \frac { f ( x ) + f ( 0 ) } 2 $, $ g _ 5 $ is a function satisfying $ g _ 5 ( x ) = f \left( \frac { x + 5 } 2 \right) - \frac { f ( x ) + f ( 5 ) } 2 $, and so on.
Take any of these functions you want, and differentiate it. You'll end up with $$ g ' _ y ( x ) = \frac 1 2 f ' \left( \frac { x + y } 2 \right) - \frac { f ' ( x ) } 2 \text . \tag 1 \label 1 $$
From the functional equation, you know that each and every one of $ g _ y $'s is in fact the constant zero function, because it's defined by \eqref{0}. Therefore, for every $ y $ you know that $ g ' _ y $ is the constant zero function, too. In particular, you must have $ g ' _ y ( 0 ) = 0 $. Use this together with \eqref{1}, and by $ f ' ( 0 ) = - 1 $ you'll get $$ f ' \left( \frac y 2 \right) = - 1 \text . \tag 2 \label 2 $$ You know \eqref{2} for every $ y $, because you did all above for each and every one of $ g _ y $'s. In particaular, you know \eqref{2} for any $ y $ of the form $ 2 x $. So for every $ x $, you have $ f ' ( x ) = - 1 $.
Please let me know if this helps, and if not, which parts are not clear to you.