The equation is $$df_t = r\,dt+\sigma f_t\,dB_t$$ According to itos formula, I get: $$\frac{\partial f}{\partial t}+\frac{1}{2} \frac{\partial^2f}{\partial x^ 2}=r$$ $$\frac{\partial f}{\partial x}= \sigma f$$
The second equation leads to: $$f=e^{\sigma x+g(t)}$$
Here is where I stuck, please help!
The general approach to solve these linear SDEs is the following. Assume we have the following linear SDE
$$dX_t = (F_t X_t +f_t)dt + (G_t X_t +g_t)dB_t \tag*{(1)}$$
where $F, G, f$ and $g$ are Borel measurable bounded functions.
The corresponding homogeneous equation of Eq (1) is $$dX_t = F_t X_tdt + G_t X_tdB_t, \tag*{(2)}$$ Equation (2) has a unique solution (this can be proved by checking that $F$ and $G$ satisfies the Lipschitz and linear growth conditions). So if one finds a solution, we know is THE solution. The solution is $$\Phi_t = \Phi_0 \exp \left(\int_{t_0}^t (F_s -\frac{1}{2}G^2_s)ds + \int_{t_0}^t G_s dB_s \right). \tag*{(3)}$$ This is a well known result (you can check that (3) is the solution to equation Eq (2) by using Ito's formula). Then the solution to Eq(1) is given by the variation-of-constants formula $$X_t = \Phi_t \left( X_0 + \int_{t_0}^t \Phi^{-1}_s[f_s - G_sg_s]ds + \int_{t_0}^t \Phi^{-1}_s g_s dB_s \right). \tag*{(4)}$$ In your case, Eq (1) simplifies a lot because we have $$f(t)= r ; \quad F(t) = 0; \quad G(t) = \sigma; \quad g(t) = 0.$$ Thus, the solution to the homogeneous equation is $$\Phi_t = \Phi_0 e^{(r - \frac{1}{2} \sigma^2)t + \sigma B_t}. \tag*{(5)}$$ (You can also get the solution (Eq (5)) by applying Ito's formula to Eq (2) with the function $f(x)= \ln x)$.
Finally, input (5) into (4) to get the solution.
For a proof of these results you can see for example Oksendal or Mao Xuerong books.