Let $E=(0, \infty)$ and $g \in L^{1}(E)$. Define $f\colon E \to \mathbb{R}$ by $$f(x)=\int_{0}^{x}g.$$
(a) Show that $f$ may not be Lipschitz on $E$.
(b) Prove that if $g \in L^{\infty}(E)$ then $f$ is Lipschitz, and find the best Lipschitz constant for $f$.
For $(a)$ at first I thought of the function $g(x)=\frac{1}{2\sqrt{x}}$. Then $f(x)=\sqrt{x}$ is not Lipschitz on ... $[0, \infty)$. This unfortunately didn't work out because $E$ excludes the point $0$. I know that $f$ is Lipschitz on $[\epsilon, \infty)$. I can't think of another example that would work.
For (b), I can do the following: for any $a, b$ in $E$ such that $a < b$: \begin{align*} |f(b)-f(a)|&=|\int_{0}^{b} g - \int_{0}^{a} g| \\ &\le \int_{a}^{b} |g |\\ &\le \Vert g\Vert_{\infty} |b-a|. \end{align*}
I suspect that $\Vert g\Vert_{\infty}$ ought to be the best possible, but how do I prove this?
Suppose $|f(x)-f(y)| \leq C|x-y|$ for all $x,y$. Then $\\frac 1 {b-a}\int_a^{b} g(x) dx|\leq C$ whenever $a<b$. By Lebesgue's Theorem, this implies $|g(a)| \leq C$ for almost all $a$. Hence, $\|g\|_{\infty} \leq C$. This proves a) because there exist integrable functions $g$ with $\|g\|_{\infty}=\infty$.
We have also proved that if $C$ is a Lischitz constant for $f$ then $\|g\|_{\infty} \leq C$. Since $\|g\|_{\infty}$ is a Lipschitz constant for $f$ by your argument, it follows that it is the smallest Lipscitz constant.