Yes, your justification is correct but needs to be expanded upon to be rigorous. In particular, it is important that not only are $f$ and $f_x$ continuous, but their $C^0$ norm is controlled by their Sobolev norm, so that a uniform bound can be derived. By Sobolev embedding theorem (since $k = 2 > n/2$ with $k$ the derivative order and $n = 1$ the dimension of the spatial domain), then there is a constant $C$ such that
$$
\|f(\cdot, t)\|_{C^0(0,L)} \le C \| f(\cdot, t)\|_{H^2(0,L)}
$$
for every $t$. Since $f(\cdot, t) \in C((0,T); H^2)$ then $\| f(\cdot, t)\|_{H^2(0,L)} \le M$ for some $M$ uniformly in $t$. Therefore
$$
|(f^p)_{xx}(x,t)| \le p (p-1) (CM)^{p-2} |f_x(x,t)|^2 + p (CM)^{p-1} |f_{xx}(x,t)|,
$$
and Sobolev embedding can again be applied instead to $f_x$ to show that its $C^0(0,L)$ norm is bounded uniformly in $t$. Carrying out the inequalities and integrating gives you a universal bound on $\|(f^p)_{xx}(\cdot, t)\|_{L^2(0,L)}$ that is a polynomial expression in $C,M,p$.