The forward direction is easy. The backwards direction, it am not sure if they want me to show $f$ is identically $0$ or $0$ a.e. I assume almost everywhere as when we are talking about functions in $L^p$ we say $f=g$ if $f=g$ a.e. If it.s a.e the proof is very simple, if this is correct:
My proof: If $f \in L^p$ then $|f|^{p-1} \in L^q$ as $p$ and $q $ are conjugates. By Holders $\int |f|^p=0$ and so $f=0$ a.e.
One way to prove this is by using Riesz theorem: If $1 \leq p < \infty$ you have a version of the Riesz representation Theorem for $L^{p}$ spaces. Let $T \in (L^{q})^{*}$ (dual of $L^{q}$) then there exists a unique $f \in L^{p}$, $\frac{1}{p} + \frac{1}{q} = 1$, such that \begin{equation} T(g) = \int_{X}{fg}dx \end{equation} for every $g \in L^{q}$, moreover, $\|f\|_{L^{p}} = \|T\|_{(L^{q})^{*}}$. From this you conclude by observing that if $T \equiv 0$ then $f = 0$.
Now, the problem with your attempt is, as you are getting $g = |f|^{p-1}$ you'd have $\int{f|f|^{p-1}}dx = 0$ and not $\int{|f|^{p}} = 0$, even if you try $f^{p-1}$, $\int{f^{p}} = 0$ doesn't imply $f = 0$ ($f$ isn't necessarily non-negative), it'd be a better choice $g = f|f|^{p-2}$ and you can conclude as you did.