Almost everywhere (ae) Homogeneous function of degree $0$ equals to a constant for almost every $x \in (0,\infty)$? Is an almost everywhere (ae) Homogeneous function of degree $0$ equals to a constant for almost every $x \in (0,\infty)$ ?

Let
   $f : \mathbb R \to \mathbb R$.
If $f(ax)=f(x)$ ae for any $a>0$
Then $f(x)=c$ for almost every $x \in (0,\infty)$, where $c$ is a constant.

Is the above even true by simply assuming $f$ is measurable?
 A: We can assume $f$ is bounded; if not, we can consider instead $\arctan f.$ The conclusion holds for $f$ iff it holds for $\arctan f.$
By the Lebesgue differentiation theorem there exists a measurable $E\subset (0,\infty)$ such that $(0,\infty)\setminus E$ has measure $0,$ and such that
$$\lim_{h\to 0}\frac{1}{h}\int_x^{x+h} f = f(x)\,\, \text {for all }x\in E.$$
Assume $x,y\in E.$ Let $a=y/x.$ Note that $ax = y\in E.$ Then
$$\frac{1}{h}\int_x^{x+h} f(t)\,dt = \frac{1}{h}\int_x^{x+h} f(at)\,dt = \frac{1}{ah}\int_{ax}^{ax+ah} f(s)\,ds.$$
As $h\to 0,$ left side converges to $f(x)$ and the right side converges to $f(ax) = f(y).$ Thus $f(x)=f(y).$ Therefore $f$ is constant on $E,$ which is the desired conclusion.
A: Here is an attempt at a proof, first prove it for a locally integrable $f$ and then extend it to measurable $f$ (with additional requirement that it is finite ae)
define $C=\int_0^1 f(t)dt$, 
for $x>0$,$g(x)=\int_0^x f(t)dt$
pick $a$ such that $ax=1$
$g(x)=\int_0^x f(t)dt=\int_0^x f(at)dt=x(ax)^{-1}\int_0^x f(at)adt=x\int_0^1 f(y)dy$
Therefore $g(x)=Cx$
so $g'=f=C$ ae on $(0, \infty)$
now for a measurable $f$ , the set $A_n=\{x : |f(x)| < n \}$ is measurable,where $n \in N$,  define $f_n=f1_{A_n}$ where $1_{A_n}$ is indicator function for set ${A_n}$. Then $f_n(x)=f_n(ax)$ for almost every $ x \in A_n $ Using similar trick as before, $f_n=C_n$ for almost every $x \in A_n$ where $C_n=\int_0^1 f_n(t)dt$
Now whenever $\mu (A_n) > 0$ , we have $f(x)=C_n=C_{n+1}=C_{n+2}....=C_{\infty}$ for almost every $x \in B=\bigcup A_n$ 
Now to finish the proof I have to assume  $\mu(B^c \bigcap [0,\infty))=0$ which is true if $f$ is finite ae
The above trick does not work once we drop the requirement of $ f $ being finite ae.
