Suppose $p$ and $q$ are conjugate exponents with $1 \leq q < \infty$. Then for each $g \in L^q$, the map $$\phi_g(f) = \int fg$$ forms an isometry from $L^q$ into $(L^p)^*$.
Showing that $\|\phi_g\| \leq \|g\|_q$ is easy using Holders inequality. To prove $\|\phi_g\| \geq \|g\|_q$, I refer to Folland's proof where he introduces $$f = \frac{|g|^{q-1}\overline{\text{sgn }g}}{\|g\|_q^{q-1}}.$$ From here the rest of the proof is easy to follow and is straight computation. However, I am conceptually confused on how this specific definition for $f$ proves the assertion for all functions $f \in L^q$?
Your second sentence is wrong and probably shows the reason for your confusion: It is the map which sends $g$ to $\varphi_g$, that is $J(g):=\varphi_g$, which constitutes the isometry $J\colon L^q\to(L^p)^*$. (To emphasize once more: $g$ is not fixed; $g$ is the argument of the isometry.)
What is true is that for fixed $g\in L^q$ the image $J(g)=\varphi_g$ is indeed an element of $(L^p)^*$. That is, for fixed $g$ you have a bounded linear functional on $L^p$, defined by $\varphi_g(f)=\int fg$. Moreover, the norm of this functional is (as you have shown) $$\lVert\varphi_g\rVert_{(L^p)^*}=\sup_{\lVert f\rVert_{L^p}\le 1}\int fg= \lVert g\rVert_{L_q}.$$ This means that the map $J\colon L^q\to (L^p)^*$ satisfies $$\lVert J(g)\rVert=\lVert g\rVert\qquad\text{for every $g\in L^q$}$$ (the norm is the norm of $(L^p)^*$ or $L^q$, respectively.) Since $J$ is linear, this means that $$\lVert J(g_1)-J(g_2)\rVert=\lVert J(g_1-g_2)\rVert=\lVert g_1-g_2\rVert\qquad\text{for all $g_1,g_2\in L^q$,}$$ and this in turn means that $J$ is an isometriy.