Solve a simple equation involving limits for $f$, $\lim_{y\to x}\frac{(x-y)^2}{f(x)-f(y)}=1$

There is a mistake, which lies in jumping from$$\lim_{y\to x}\frac{(y-x)^2}{f(y)-f(x)}=1\quad\text{to}\quad\lim_{y\to x}(y-x)^2=\lim_{y\to x}f(y)-f(x).$$For instance,$$\lim_{x\to 0}\frac{\sin\left(\frac1x\right)}{\sin\left(\frac1x\right)}=1,$$but the limit $\lim_{x\to0}\sin\left(\frac1x\right)$ does not exist.

Note that\begin{align}\lim_{y\to x}\frac{(y-x)^2}{f(y)-f(x)}=1&\iff\lim_{y\to x}\frac{f(y)-f(x)}{(y-x)^2}=1\\&\iff\lim_{y\to x}\frac{f(y)-f(x)}{y-x}\cdot\frac1{y-x}=1.\end{align}But, since $\lim_{y\to x}\left|\frac1{y-x}\right|=\infty$, it follows from this that $\lim_{y\to x}\frac{f(y)-f(x)}{y-x}=0$. In other words, $f'$ is the null function. And so, yes, $f$ must be constant. But note that I only proved that if such a function exits, then it must be constant. Since no constant function is a solution of your problem, the problem has no solution.