When do we have the formula $f(t)=e^{\lambda t}f(0)+\int_0^te^{\lambda (t-s)}g(s)ds$? Let $g:\mathbb{R}\to \mathbb{R}$ be a continuous  function. Consider the following integral equation
$$f(t)=f(0)+\int_0^t\lambda f(s)ds+\int_0^tg(s)ds. \tag{1}$$
Since $g$ is continuous, 
Thus the integral equation $(1)$ has a solution $f$ which is derivable everywhere and is given by:
$$f(t)=e^{\lambda t}f(0)+\int_0^te^{\lambda (t-s)}g(s)ds,\tag{2}$$
because $(2)$ implies that  $f$  satisfies the following differential equation
$$f'=\lambda f+g,$$
and then satisfies $(1)$.
(To be correct, we have a lot of solutions, since changing $f(0)$ gives other solutions)
Now if we assume that $g$ is only locally integrable. Do we still have a solution of the integral equation $(1)$ ? and can it be given also by the formula 
$$f(t)=e^{\lambda t}f(0)+\int_0^te^{\lambda (t-s)}g(s)ds.$$
 A: If $g$ is locally integrable, then the function $f(t):=e^{\lambda t}f(0)+\int_0^te^{\lambda(t-s)}g(s)\,ds$ is well-defined and continuous, and it's not difficult to show that this $f$ is a solution of your integral equation $f(t) = f(0)+\int_0^t\lambda f(s)\,ds+\int_0^t g(s)\,ds$ (using Fubini's theorem).  
If $\tilde f$ is a second (locally integrable) solution of the integral equation, with the same initial value, then the difference $h(t):=f(t)-\tilde f(t)$ satisfies $h(t) =\lambda\int_0^t h(s)\,ds$ for $t\ge 0$. The integral on the right side  of this equality is continuous, hence $h$ is continuous; we now deduce (Fundamental Theorem of Calculus) that the integral on the right side is in fact continuously differentiable. Differentiating we find that $h'(t)=\lambda h(t)$, and clearly $h(0)=0$. The unique solution of this ODE is $h(t)=0$ for all $t$. Thus your integral equation has a unique solution, given by the earlier formula.
A: Suppose you have a locally integrable $g$ and a function $f$ such that
\begin{align}
     f(t) & = e^{\lambda t}f(0)+\int_{0}^{t}e^{\lambda(t-s)}g(s)ds \\
     e^{-\lambda t}f(t) & = f(0)+\int_{0}^{t}e^{-\lambda s}g(s)dt
\end{align}
The function $e^{-\lambda t}f(t)$ is locally absolutely continuous, which also means that $f$ must be locally absolutely continuous, and the following holds a.e.:
$$
       e^{-\lambda t}f'(t) -\lambda e^{-\lambda t}f(t) = e^{-\lambda t}g(t) \\
         f'(t) -\lambda f = g \\
          f'(t) = \lambda f + g.
$$
Because $f$ is absolutely continuous, integration of $f'$ gives back $f$:
$$
         f(t)-f(0) = \int_{0}^{t} f'(s)ds = \lambda \int_{0}^{t}f(s)ds+\int_{0}^{t}g(s)ds \\
          f(t) = f(0)+\lambda \int_{0}^{t}f(s)ds+\int_{0}^{t}g(s)ds.
$$
