TITLE: Can a function $f:\mathbb{R} \rightarrow \mathbb{R}$ be "infinitely steep" on a set with non-zero Lebesgue outer measure?
QUESTION [10 upvotes]: By being "infinitely steep" on a set I mean that for each point $x$ in the set we have $\sup\limits_{\delta>0}\text{ }\inf\limits_{y\in(x-\delta,\text{ }x+\delta)\backslash\{x\}}\frac{f(y)-f(x)}{y-x}=\infty$. As a remark, the Cantor function is infinitely steep on the Cantor-Set which is uncountable, but of course has Lebesgue measure $0$.

REPLY [5 votes]: The Denjoy–Young–Saks theorem gives the stronger result that the left and right lower derivatives can only be $\infty$ on a null set: defining
$$D_-f(x):=\liminf_{y\to x^-} \frac{f(y)-f(x)}{y-x}$$
$$D_+f(x):=\liminf_{y\to x^+} \frac{f(y)-f(x)}{y-x}$$
then $\{x\mid D_-f(x)=\infty\}$ and $\{x\mid D_+f(x)=\infty\}$ are null sets. 
The set of $x$ such that $\liminf_{y\to x} \frac{f(y)-f(x)}{y-x}=\min(D_+f(x),D_-f(x))=\infty$ is therefore a null set.
Here is an cut-down argument for your specific question. For each integer $n\geq 1$ define
$$C_n=\{x\mid f(\lambda)\leq f(\mu)\text{ for all }\lambda\in(x-1/n,x)\text{ and }\mu\in(x,x+1/n)\}.$$
Each $C_n$ is measurable because it's a closed set. For any real $q,$ the restriction of $f$ to the set $D_{n,q}$ of density points of $C_n\cap (q,q+1/n)$ is non-decreasing: between two points $\lambda<\mu$ in $D_{n,q}$ there's another density point, which forces $f(\lambda)\leq f(\mu).$ This restriction can therefore be extended to a non-decreasing function $g_{n,q}$ on the open interval $(\inf D_{n,q},\sup D_{n,q})$: define $g_{n,q}(x)=\sup\{f(y)\mid y\in (-\infty,x]\cap D_{n,q}\}.$ Since $g_{n,q}$ is non-decreasing it is a.e. differentiable.
Whenever $g_{n,q}'(x)$ exists and $x\in D_{n,q}$ we have
$$\liminf_{y\to x} \frac{f(y)-f(x)}{y-x}\leq \lim_{\substack{y\to x\\y\in D_{n,q}}}\frac{f(y)-f(x)}{y-x}=g_{n,q}'(x)<\infty\tag{1}$$
Let $S$ be the set of points with $\liminf_{y\to x} \frac{f(y)-f(x)}{y-x}=\infty.$ 
Since (1) holds for a.e. $x\in C_n\cap(q,q+1/n),$ each set $S\cap C_n\cap (q,q+1/n)$ is a null set. So $$S=\bigcup_{n=1}^\infty\bigcup_{q\in\mathbb Q} S\cap C_n\cap (q,q+1/n)$$
is a null set.