How to prove $f(x)=ax$ if $f(x+y)=f(x)+f(y)$ and $f$ is locally integrable
Integrate the functional equation with respect to $x$ between $0$ and $1$. The result is the equation $$ \int_y^{y+1} f(u) du = \int_0^1 f(x) dx + f(y) \text . $$ The integral on the left side exists and is continuous in $y$ because $f$ is locally integrable. Therefore the right side is also continuous in $y$; that is, $f$ is continuous! The rest is clear sailing.
Define $$ g ( x ) = \int _ 0 ^ x f ( t ) \, \mathrm d t \text , $$ which can be done, since $ f $ is locally integrable. It's easy to see that $$ g ( x + y) = \int _ 0 ^ { x + y } f ( t ) \, \mathrm d t = \int _ 0 ^ x f ( t ) \, \mathrm d t + \int _ x ^ { x + y } f ( t ) \, \mathrm d t = g ( x ) + \int _ 0 ^ y f ( x + t ) \, \mathrm d t \\ = g ( x ) + \int _ 0 ^ y \big( f ( x ) + f ( t ) \big) \, \mathrm d t = g ( x ) + \int _ 0 ^ y f ( t ) \, \mathrm d t + \int _ 0 ^ y f ( x ) \, \mathrm d t = g ( x ) + g ( y ) + y f ( x ) \text . $$ By symmetry, we get $ g ( x + y ) = g ( x ) + g ( y ) + x f ( y ) $. So $$ y f ( x ) = x f ( y ) \text . $$ Letting $ a = f ( 1 ) $ and putting $ y = 1 $ in the last equation, we have $$ f ( x ) = a x \text . $$
This is known as Cauchy's functional equation. It is easy to see that $f(0)=0$, as $f(x)=f(x+0)=f(x)+f(0)$ for all $x$. If we let $a=f(1)$, we get that $f(n)=f(\underbrace{1+1+\dots+1}_{n\text{ times}})=an$ for any $n\in\mathbb Z$ by induction, and similarly we see that $$bf\left(\frac n b\right)=\underbrace{f\left(\frac n b\right)+\dots+f\left(\frac n b\right)}_{b\text{ times}}=f\Big(\underbrace{\frac n b+\dots+\frac n b}_{b\text{ times}}\Big)=f(n)=an$$ so $f(x)=ax$ for any rational $x$. To extend this to all real $x$ under your restrictions, I suggest you look at other solutions than $ax$ and examine how they differ near $0$, then observe that these solutions also get scaled by addition and so blow up to be very different from $ax$ away from the origin. I will let you work this part out on your own.