6. 135 Let $N$ be the set of all positive integers, and $f$ a function from $N$ to $N$ itself, such that for any $s$ and $t$ in $N$, the following holds:
$$f\left(t^{2} f(s)\right)=s(f(t))^{2}$$

Determine the smallest possible value of $f(1998)$ among all such functions $f$.
(1)
Let $t=1$, we get
$f(f(s))=s(f(1))^{2}$.
(2)
Let $s=1$, substitute into (1) to get
$f\left(t^{2}(f(1))=(f(t))^{2}\right.$.
(3)
Let $f(1)=K$, then (2) and (3) become
$f(f(s))=K^{2} s$,
(4)
$$f\left(K t^{2}\right)=(f(t))^{2}$$
(5)
Let $s=1$, substitute into (4) to get
$f(K)=K^{2}$.
Let $s=f(K)$, substitute into (1) to get
$f\left(t^{2} K^{3}\right)=K^{2} f(t)^{2}$.
On the other hand, from (5) we have
$$f\left(t^{2} K^{3}\right)=f\left(K(K t)^{2}\right)=(f(K t))^{2},$$

Comparing the above two equations, we have
$$\begin{array}{l}
(f(K t))^{2}=K^{2}(f(t))^{2} \\
f(K t)=K f(t)
\end{array}$$

Substitute (6) into (5)
$$K f\left(t^{2}\right)=(f(t))^{2}$$

In the above equation, replace $t$ with $t^{2}, t^{4}, \cdots, t^{t^{m-1}}$, respectively, to get
$$\begin{array}{l}
K f\left(t^{4}\right)=\left(f\left(t^{2}\right)\right)^{2} \\
K f\left(t^{8}\right)=\left(f\left(t^{4}\right)\right)^{2} \\
\cdots \cdots \\
K f\left(t^{m^{m}}\right)=\left(f\left(t^{2^{m-1}}\right)\right)^{2}
\end{array}$$

Square the first equation and compare with the second to get
$$K^{3} f(t)^{4}=(f(t))^{4},$$

Square again and compare with the third equation to get
$$K^{7} f\left(t^{8}\right)=(f(t))^{8},$$

Proceeding in this manner, we finally get
$$K^{2^{m}-1} f\left(t^{2^{m}}\right)=(f(t))^{2^{m}}$$

Here $m$ is any positive integer.
Take any prime factor $p$ of $K$, and let $p^{\alpha}\left\|K, p^{\beta}\right\| f(t)$.
From (7) we get
$$\alpha\left(2^{m}-1\right) \leqslant \beta \cdot 2^{m}$$

Thus, $\frac{\beta}{\alpha} \geqslant \frac{2^{m}-1}{2^{m}}$,
Taking the limit on both sides, we get $\square$
$$\frac{\beta}{\alpha} \geqslant \lim _{m \rightarrow \infty} \frac{2^{m}-1}{2^{m}}=1,$$

i.e., $\beta \geqslant \alpha$.
From the above inequality and the arbitrariness of $p$, we know
$$K \mid f(t)$$

Thus, let
$$g(t)=\frac{f(t)}{K} .$$

Clearly, $g(t)$ is also a function from $N$ to $N$.
From (6) and the definition of $g(t)$, we have
$$\begin{aligned}
f\left(t^{2} f(s)\right) & =f\left(t^{2} \cdot K g(s)\right) \\
& =K f\left(t^{2} g(s)\right)=K^{2} g\left(t^{2} g(s)\right) \\
s(f(t))^{2} & =K^{2} s(g(t))^{2}
\end{aligned}$$

From (1) and the above two equations, we get
$$g\left(t^{2} g(s)\right)=s(g(t))^{2}$$

This shows that $g$ is also a function that satisfies the conditions of the problem, and $g(1)=1$. Therefore, all the results about the function $f$ apply to $g$, with the note that $K=g(1)=1$.

From (4) and (5) we get
$$\begin{array}{l}
g(g(s))=s \\
g\left(t^{2}\right)=(g(t))^{2}
\end{array}$$
(9)
(10)
In (8), replace $s$ with $g(s)$, we have
$$g\left(t^{2} s\right)=g(s)(g(t))^{2}$$

Using (11) and (1), we know: for any $a, b \in N$,
$$\begin{aligned}
(g(a b))^{2} & =g\left(a^{2} b^{2}\right) \\
& =g\left(a^{2}\right) \cdot(g(b))^{2}=(g(a))^{2} \cdot(g(b))^{2}
\end{aligned}$$

i.e., $g(a b)=g(a) \cdot g(b)$.
(11)

From (9), we know that $g$ is injective. In particular, for all $a \neq 1$, $g(a) \neq 1$. From (12), we know that if $a$ is composite, then $g(a)$ must be composite.
Also, from $g(g(p))=p$, we know that if $p$ is prime, then $g(p)$ must be prime. Since $1998=2 \times 3^{3} \times 37$, we have
$$\begin{aligned}
f(1998) & =K g(1998)=K \cdot g(2) \cdot(g(3))^{3} \cdot g(37) \\
& \geqslant\left(2^{3} \cdot 3 \cdot 5\right) \cdot K=120 K \geqslant 120
\end{aligned}$$

On the other hand, define the function $f$ as follows:
$$\begin{array}{l}
f(1)=1 \\
f(2)=3 \\
f(3)=2, \\
f(5)=37 \\
f(37)=5 \\
f(p)=p \quad(p \text { is any other prime }) \\
f(n)=\left(f\left(p_{1}\right)\right)^{a_{1}} \cdot\left(f\left(p_{2}\right)\right)^{a_{2}} \cdots\left(f\left(p_{l}\right)\right)^{a_{l}}
\end{array}$$

where the standard factorization of $n$ is $n=p_{1}^{a_{1}} \cdot p_{2}^{a_{2}} \cdots p_{1}^{a_{1}}$.
Under the above definition, it is easy to verify that such an $f$ satisfies the conditions of the problem, and $f(1998)=120$.
In conclusion, the minimum value of $f(1998)$ is 120.