This answers the problem as stated originally, i.e determines for which $f$ the following holds $ \lim_{h\to 0} \frac{f^2(x+h) - f(x)}{h} = \lim_{h\to 0} \frac{f(x+h) - f(x)}{h} $
I assume that $f^2(x)$ is supposed to mean $(f(x))^2$. Then, for $\lim_{h\to 0}\frac{f^2(x+h) - f(x)}{h}$ to exist, it must be that $\lim_{h\to 0}f^2(x+h) = f(x)$. If $f$ is continuous, you get $f^2(x) = f(x)$ and thus $f(x) \in \{0,1\}$. If $f$ is not continous, the question makes no sense because it then certainly is not derivable, hence the right-hand side limit in your question does not exist.
Note that $f$ must not necessarily be constant globally, but it must be constant on every connected $A \subset \text{dom }f$. Thus, $f: \mathbb{R}\setminus\{0\} \to \{0,1\}$, $ f(x) = \begin{cases} 0 &\text{if } x < 0\\ 1 &\text{if } x > 0 \end{cases} $ is a possible solution. As are the constant functions $0$ and $1$, of course.
And now for $ \lim_{h\to 0} \frac{f^2(x+h) - f^2(x)}{h} = \lim_{h\to 0} \frac{f(x+h) - f(x)}{h} $
This is quite obviously equivalent to $((f(x))^2)' = f'(x)$, which by applying the chain law yields $2f(x)f'(x) = f'(x)$. To have that, it must thus either be that $f(x) = \frac{1}{2}$ or that $f'(x) = 0$ (where the format also implies the latter). Thus, any function which is constant on all connected $A \subset \text{dom } f$ works.