You don't find $w$. $w$ is a "given", in the following sense. For the weak formulation of the problem to make sense, the statement
$$ u|_{\partial\Omega} = g $$
is in fact the following statement: $\exists$ a fixed $w \in H^1(\Omega)$ such that the trace of $w$ to $\partial \Omega$ is equal to the trace of $u$.
The relevant section in Evans is trying to explain this. Basically what he is trying to say is that the intuition for the Dirichlet problem with "strong" solutions, where you prescribe boundary value as some continuous function $g$ on the boundary, must be replaced by an appropriate weak version defined relative to the trace operator to hypersurfaces, when you consider the weak formulation of the problem. This is because a solution $u$, as an object in the space $W^{1,2} = H^1$, is only an equivalent class of functions defined up to sets of measure zero. If $\Omega$ is a sufficiently regular open set, $\partial\Omega$ has measure zero, so it is meaningless to state that $u$ coincides with $g$ on $\partial\Omega$, since $u$ can always be modified on just $\partial\Omega$ to give any value you want there.
You should compare this to, for example, Theorem 8.3 in Gilbarg and Trudinger, Elliptical partial differential equations of second order, which states
Let [$L$ be an elliptic operator]. Then for $\psi \in W^{1,2}(\Omega)$ and $g,f^i\in L^2(\Omega)$, $i = 1 , \ldots, n$, the generalized Dirichlet problem, $Lu = g + D_i f^i$ in $\Omega$, $u = \psi$ on $\partial\Omega$ is uniquely solvable.
Best Answer
Weak solutions of the equation are critical points of the energy functional $$ E(u)=\int_\Omega\Bigl(\frac12|\nabla u|^2+\frac1{3}|u|^3-f\,u\bigr)dx. $$ Observe that $E(u)$ is well defined on the Banach space $X=H^1_0(\Omega)\cap L^3(\Omega)$.
To show the existence of a solution it is enough to show that $E$ attains its minimum on $X$. This is done by showing that $E$ is strictly convex and coercive (i.e. $E(u)\to\infty$ if $\|u\|_X\to\infty$).
Uniqueness follows (by a different method) because the function $g(u)=u\,|u|$ is increasing.
There are many books on variational methods. One of them is Introduction à la théorie des points critiques by O. Kavian (in french.) A more general case of your question is solved on page 139.
The following is a formal explanation; I will not go into the details of the correct spaces,...
The weak formulation of the problem is $$ \int_\Omega\bigl(\nabla u\cdot\nabla u+u\,|u|\,v-f\,v\bigr)dx=0\quad v\text{ a test function.} $$ The energy functional is a functional $E:X\to\mathbb{R}$ whose derivative with respect to $u$ is given precisely by the weak formulation. What does ths mean? The differential at $u$ is defined as an element $E'(u)$ of de dual of $X$ such that $$ E(u+v)=E(u)+\langle E'(u),v\rangle+o(\|v\|). $$ One way to compute it is $$ \langle E'(u),v\rangle=\lim_{t\to0}\frac{E(u+t\,v)-E(v)}{t}. $$ Using this it is easy to show that $E(u)$ is in fact the energy functional associated to the equation. Observe that $|u|^3/3$ is a primitive of $u\,|u|$.