8. Given a finite graph $G$, let $f(G)$ be the number of 3-cliques in $G$, and $g(G)$ be the number of 4-cliques in $G$. Find the smallest constant $c$ such that for every graph $G$,
$$
(g(G))^{3} \leqslant c(f(G))^{4} .
$$
8. Let the vertices of a finite graph $G$ be $V_{1}, V_{2}, \cdots, V_{n}$, and let $E$ be the set of its edges, with $|E|$ denoting the number of elements in the set $E$. Our first task is to establish the relationship between $f(G)$ and $|E|$.

Assume the degree of vertex $V_{i}$ is $x_{i}$, meaning $x_{i}$ edges emanate from $V_{i}$. The set of the second endpoints of these $x_{i}$ edges, different from $V_{i}$, is denoted as $A_{i}$, so $\left|A_{i}\right|=x_{i}$. Let $y_{i}$ and $z_{i}$ be the number of $K_{3}$ and $K_{4}$ subgraphs containing vertex $V_{i}$, respectively. Then we have
$$
\sum_{i=1}^{n} x_{i}=2|E|, \sum_{i=1}^{n} y_{i}=3 f(G), \sum_{i=1}^{n} z_{i}=4 g(G) \text {. }
$$

Let $E_{i}$ be the set of all edges whose endpoints are both in $A_{i}$. Each such edge corresponds to a unique $K_{3}$ with vertex $V_{i}$, so $y_{i}=\left|E_{i}\right|$. Since $\left|A_{i}\right|=x_{i}$, the set $E_{i}$ can have at most $\mathrm{C}$ edges, i.e., $y_{i} \leqslant \mathrm{C}_{x_{i}}^{2}$. 
Furthermore, since $E_{i} \subset E$, $\mathrm{C}_{x_{i}}^{2} \leqslant \frac{x_{i}^{2}}{2}$, so we have
$$
\begin{array}{l}
y_{i}=\sqrt{\left|E_{i}\right|} \cdot \sqrt{y_{i}} \leqslant \sqrt{\left|E_{i}\right|} \cdot \sqrt{\mathrm{C}_{x_{i}}^{2}} \\
\leqslant \sqrt{\left|E_{i}\right|} \cdot \frac{\sqrt{2} x_{i}}{2} \leqslant \sqrt{|E|} \cdot \frac{\sqrt{2} x_{i}}{2} .
\end{array}
$$

Summing over $i$ gives $3 f(G) \leqslant \sqrt{|E|} \cdot \sqrt{2}|E|$, i.e.,
$$
(f(G))^{2} \leqslant \frac{2}{9}|E|^{3} \text {. }
$$

This inequality holds for all graphs. In particular, it holds for the graph $G_{i}$ formed by the vertex set $A_{i}$ and the edge set $E_{i}$. Therefore, for $i=1,2, \cdots, n$, we have
$$
\left(f\left(G_{i}\right)\right)^{2} \leqslant \frac{2}{9}\left|E_{i}\right|^{3},
$$

where $f\left(G_{i}\right)$ is the number of $K_{3}$ subgraphs with vertices in $A_{i}$ and edges in $E_{i}$. For each such $K_{3}$, there is a unique $K_{4}$ corresponding to vertex $V_{i}$, so $z_{i}=f\left(G_{i}\right)$. Hence,
$$
\begin{array}{l}
z_{i}=\left(f\left(G_{i}\right)\right)^{\frac{1}{3}}\left(f\left(G_{i}\right)\right)^{\frac{2}{3}} \\
\leqslant\left(f\left(G_{i}\right)\right)^{\frac{1}{3}}\left(\frac{2}{9}\right)^{\frac{1}{3}} \cdot\left|E_{i}\right| \\
\leqslant(f(G))^{\frac{1}{3}}\left(\frac{2}{9}\right)^{\frac{1}{3}} \cdot y_{i} .
\end{array}
$$

Summing over $i$ gives
$$
4 g(G) \leqslant(f(G))^{\frac{1}{3}} \cdot\left(\frac{2}{9}\right)^{\frac{1}{3}} \cdot 3 f(G),
$$

i.e., $(g(G))^{3} \leqslant \frac{3}{32}(f(G))^{4}$. 
Thus, $c=\frac{3}{32}$ is a constant that satisfies the condition, and it is the smallest. 
Considering the complete graph with $n$ vertices, as $n \rightarrow+\infty$,
$$
\begin{array}{l}
\frac{\left(g\left(K_{n}\right)\right)^{3}}{\left(f\left(K_{n}\right)\right)^{4}}=\frac{\left(\mathrm{C}_{n}^{4}\right)^{3}}{\left(\mathrm{C}_{n}^{3}\right)^{4}} \\
=\frac{(3!)^{4}[n(n-1)(n-2)(n-3)]^{3}}{(4!)^{3}[n(n-1)(n-2)]^{4}} \rightarrow \frac{(3!)^{4}}{(4!)^{3}}=\frac{3}{32},
\end{array}
$$

Therefore, the smallest constant $c=\frac{3}{32}$.