TITLE: Can a continuous, nowhere differentiable function have specified "shape" at every point?
QUESTION [7 upvotes]: I'm a bit embarrassed to admit that:
a) This is a rather unmotivated question.
b) I can't remember whether or not I've asked this before, but searching doesn't seem to turn anything up so ...
Consider some "shape" function $\phi: \mathbf{R} \to \mathbf{R}$. Then given some function $f: \mathbf{R} \to \mathbf{R}$, one can ask whether the "difference quotient",
$\lim_{y\to x} \frac{f(y)-f(x)}{\phi(y-x)}$,
exists at various points $x$. Letting $\phi(x) = x$ corresponds to taking normal derivatives, and intuitively when the limit exists this means that near $x$, the function $f$ "looks like" $\phi$ does near 0. 
However, if the ratio $\phi(x)/x$ is not bounded above or away from 0 as $x\to 0$ (I'm mostly thinking of the case when it is neither, so that $\phi$ is "wildly oscillating" in some sense), then anywhere the above limit exists and is nonzero, the function $f$ is necessarily non-differentiable. 
My question: If $\phi$ is some wildly oscillating function as described above (pick your favorite), can there be an $f$ for which this limit exists everywhere?
(Edit: I suppose I really want $\phi$ and $f$ to be continuous functions.)

REPLY [6 votes]: Assume WLOG that $\phi(x)>0$ when $x>0$. Since the limit described exists for all $x$ in the source of $f$. We get for any $x$ the bound:
$f(x+\delta)-f(x) \leq C\phi(\delta)$
for $0 < \delta < \delta_0$ for some $C,\delta_0>0$ which may depend on $x$.
diving by $\delta$ we get by the assumptions on $\phi$ that
$\underline{\lim}_{\delta \to 0} ( \frac{f(x+\delta) - f(x)}{\delta}) \leq 0$
This is one the four derivatives of $f$, and proposition 2 chapter 5 in Real Analysis by H.L. Royden states that if $f$ is continuous then it is (non-strictly) decreasing. Similar for increasing. So $f$ is constant.