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?