Solving the PDE 
Find the function $f=f(x,u,u')$ for which the equality
$$\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial u'} \right)=\frac{\partial^2}{\partial x^2}\left( u+u^2\right)$$ holds.
Here, $u=u(x)$ and $u'=\partial u/\partial x$. It is presumed that $u(x)\rightarrow0$ as $x \rightarrow \pm \infty$.

This is what I have tried so far: Integrate once to find
$$\left(\frac{\partial f}{\partial u'} \right)=\frac{\partial}{\partial x}\left( u+u^2\right)$$
Can I now do this and somehow resolve through per partes?
$$f=\int \frac{\partial}{\partial x}\left( u+u^2\right)\partial u'$$
Maybe the differential $\partial u'=\partial(du/dx)$ can be in some way simplified.

I have found an $f$ that satisfies your equation.
$$f=\left[\frac{1}{2}+u\right](u’)^2+g(x,u)$$
where $g(x,u)$ is some unknown function that would need to be found using boundary or some other data.
To make this as simple as possible, let’s do this the easy way and start with your final equation.
$$f=\int\frac{\partial}{\partial x}(u+u^2)\;\partial u’$$
It is best to interpret this integral representation as the anti-derivative. With that said, there isn’t much stopping you from taking the anti-derivative w.r.t. $u’$. Differentiate inside the expression and do so.
$$f=\int(u’+2uu’)\;\partial u’=\frac{1}{2}(u’)^2+u(u’)^2+g(x,u)$$
The extra term $g(x,u)$ is necessary as we took the anti derivative w.r.t. $u’$. Plugging the result back into your equation verifies that this is a solution.
Aside: Your PDE closely resembles that of the Euler-Lagrange equation.
$$\frac{d}{dx}\frac{\partial f}{\partial u’}=\frac{\partial f}{\partial u}$$
If $f$ we’re to satisfy this equation, it would be called a “Lagrangian”. However, I believe this would result in a different $f$ than your given problem. Just an extra tid-bit.
