If you only want locally summable functions $g$, the infimum is equal to 1 and is attained for $ g(x) = 1 \, (x < 0), \, g(x) = 1-x \, (0 \le x \le 1), \, g(x) = 0 (x > 1) \, .$ The reason is that on the interval $(0,1)$ the Euler-Lagrange equation is equivalent to $g''(x) = 0$ (so the minimizer should be linear there) and outside that interval clearly constant functions minimize the integrand.
If you want $g \in L^1(\mathbb{R})$, the infimum does not exist. To see this, you can define $g_n(x) = g(x) \, (x \ge 0)$ where $g$ is as before and $g_n(x) = \max(0,1 + x/n)$ for $x < 0$. Then $ \int_\mathbb{R} |\nabla g_n|^p = 1 + n^{1-p} $ so we have a minimizing sequence and the infimum should be 1. But that's clearly impossible, there is no integrable function with this property.