Find all functions $f:\mathbb{R}\rightarrow\mathbb{R}$ such that
$$
\forall (x,y)\in\mathbb{R}^2,x\ne y,\quad \min (f(x),f(y)) \leq \frac{f(x)-f(y)}{x-y} \leq \max(f(x),f(y))
$$
I have started with $f$ continuous, then precisely here $f$ is differentiable and $f'=f$; Thus, $$ f(x)=K\exp(x) $$ Now,if $f$ has a discontinuity point with a different limit to the left and right we have a contradiction.
How can I continue ?
Thank you in advance for your help,
NB: If anyone has a better title ..
The zero function is a trivial solution. For any nonzero function we may assume by symmetry that $f(x)>0$ for some $x$.
Assume there exists $x$ with $f(x)>0$ and $y$ with $f(y)\le 0$. By repeatedly replacing one of $x,y$ with their mean $\frac{x+y}{2}$ we can assume that $|x-y|<1$. Then $$ \left|\frac{f(x)-f(y)}{x-y}\right|=\frac{|f(x)|+|f(y)|}{|x-y|}>\max\{|f(x)|,|f(y)|\}$$ gives us a contradiction. Thus if $f(x)>0$ somewhere, $f(x)>0$ everywhere. Then $f$ is strictly increasing, hence the only way for $f$ to be not continuous at some point $x_0$ is that we have $d:=\lim_{x\to x_0^+}f(x)-\lim_{x\to x_0^-}f(x)>0$ (note that the onesided limits exist to begin with). Then for $y<x_0<x$ we have $$\frac{f(x)-f(y)}{x-y}>\frac d{x-y}.$$ As $x\to x_0^+$ and $y\to x_0^-$ this grows without bound contradicting $\max\{f(x),f(y)\}\to\lim_{x\to x_0^+}f(x)<\infty$. Therefore $f$ is continuoous and your original argument shows that it is of the form $f(x)=Ke^x$.