I am following the proof of the following Poincaré's inequality from the Lieb and Loss textbook
8.12 Let $Ω∈\mathbb{R}^n$ be a bounded, connected open set that has the cone property for some $θ$ and $r.$ Let $1≤p≤∞$, and let $g$ be a function in $L^{p′}(Ω)$, s.t. $\int_{Ω}g=1.$ Let $1 < q < np/(n - p)$ when $p < n,$ $q <\infty$, when $p = n,$ and $1 < q <\infty$ when $p > n.$ Then there is a finite number $S>0,$ which depends on $Ω,g,p,q$ such that \begin{equation}\lvert|f−\int_Ωfg\rvert|_{L^q(\Omega)}≤S||∇f||_{L^p(\Omega)},\quad \quad\quad \quad (1)\end{equation} $∀f∈W^{1,p}(Ω).$
They begin the proof by assuming $q\geq p$. Then they assume, by contradiction, that the Poincaré inequality $(1)$ is false for every $S>0$.
I don't understand the next part: Then there is a sequence of functions $f_j$, such that the left side of the inequality $(1)$ equals to $1$, for all $j$, while the right side tends to zero as $j\rightarrow \infty$.
Next they let $h_j=f_j+\int_{\Omega}gf_j$, such that the gradient of $f_j$ equals the gradient of $h_j$. (Why?) Then the sequence $h_j$ is bounded in $W^{1,p}(\Omega).$
The rest of the proof I think makes sense and follows from Rellich-Kondrachov theorem, but I was wondering if someone can please ellaborate on the bolded steps?
If the Poincaré inequality is false for every $S$, then for each $j$, we may take $S=j$ to see that there exists a function $f_j$ for which $$\begin{equation}\lvert|f_j−\int_Ωf_j g\rvert|_{L^p(\Omega)}> j ||∇f_j||_{L^p(\Omega)},\quad \quad\quad \quad (1)\end{equation}$$ Both sides are homogeneous in $f$, so by replacing $f_j$ with $c_j f_j$ for some constant $c_j$, we can assume the left side equals 1. Therefore we have $||∇f_j||_{L^p(\Omega)} < 1/j$ which tends to 0 as $j \to \infty$.
Replacing $f_j$ with $h_j$ by adding the constant $\int g f_j$ is just a convenience. The left side now equals $1 = \|h_j\|_{L^p}$ and the right side still equals $\|\nabla f_j\|_{L^p} = \|\nabla h_j\|_{L^p} < 1/j$. Then the $W^{1,p}$ norm of $h_j$ is comparable to $\|h_j\|_{L^p} + \|\nabla h_j\|_{L^p} = 1 + 1/j \le 2$.
Some authors would summarize this step just by saying: suppose without loss of generality that $\int g f_j = 0$.