Some theory
If the path is parametrized by $r(t) = (x(t),y(t))$, then by assumption $r'(t)= (x'(t),y'(t))$ is parallel to $-\nabla f (x(t),y(t))$, or $r'(t) = a(t) (-f_x(r(t)),-f_y(r(t)))$ for some positive constant $a$ depending on $t$.
This implies $ (-f_y(r(t)),f_x(r(t)))\cdot r'(t)=0$, and if we can show that for some $g$, $(-f_y,f_x)=(g_x,g_y)$, then the chain rule applied to $g(r(t))$, gives
$$\frac{d}{dt} g(r(t)) = (g_x(r(t)),g_y(r(t))) \cdot r'(t)=(-f_y(r(t)),f_x(r(t)))\cdot r'(t)=0,$$
$\Rightarrow g$ is constant along the path.
Solution
Let's then try to find $g$ such that $(g_x,g_y) = (-f_y,f_x)$.
First observe that
$$f_x = 4x^3 - 12xy^2 -4x, ~f_y = 4y^3 - 12x^2y +4y.$$
or
$$f_x = 4x(x^2-3y^2-1),~f_y = 4y(y^2-3x^2+1).$$
If $g_y =f_x$, integrating $f_x$ with respect to $y$ then gives:
$$g = 4x (yx^2 -y^3-y)+c(x)=4xy(x^2-y^2-1)+c(x).$$
Use this and the formula for $f_y$ to calculate $g_x$:
$$g_x = 4y(x^2-y^2-1)+4xy 2x+ c'(x) =-4y^3 +12x^2 y - 4y +c'(x).$$
This is equal to $-f_y$ if and only if $c'(x)=0$, that is, $c$ is a constant function.
In other words, the conditions can be only satisfied by a function of the form
$g(x,y) = 4xy(x^2-y^2-1)+c$. But clearly this function satisfies the conditions. We're done.