6. 180 Determine all functions \( f: \mathbb{R} \rightarrow \mathbb{R} \), where \(\mathbb{R}\) is the set of real numbers, such that for all \( x, y \in \mathbb{R} \), the following holds:
\[ f(x - f(y)) = f(f(y)) + x f(y) + f(x) - 1 \]

establish.
［Solution］Let
$$A=\operatorname{Im}f$$

be the image set of the function $f$, and let
$$f(0)=c$$

In the given functional equation, setting $x=y=0$, we have
$$f(-c)=f(c)+c-1$$

Thus,
$$c \neq 0$$

In the given functional equation, setting $x=f(y)$, we have
$$f(0)=f(x)+x^{2}+f(x)-1$$

which implies
$$f(x)=\frac{c+1}{2}-\frac{x^{2}}{2}, \quad x \in A$$

In the given functional equation, setting $y=0$, we have
$$f(x-c)=f(c)+c x+f(x)-1$$

which implies
$$f(x-c)-f(x)=c x+f(c)-1, \quad x \in \mathbb{R}$$

Since $c \neq 0$, it follows that
$$\{c x+f(c)-1 \mid x \in \mathbb{R}\}=\mathbb{R}$$

Thus,
$$\{f(x-c)-f(x) \mid x \in \mathbb{R}\}=\mathbb{R}$$

From the above, for any real number $x$, there exist $y_{1}=f(x^{*}-c)$ and $y_{2}=f(x^{*})$ such that $x=y_{1}-y_{2}$. Using (1), we get
$$\begin{aligned}
f(x) & =f(y_{1}-y_{2}) \\
& =f(y_{2})+y_{1} y_{2}+f(y_{1})-1 \\
& =\frac{c+1}{2}-\frac{y_{2}^{2}}{2}+y_{1} y_{2}+\frac{c+1}{2}-\frac{y_{1}^{2}}{2}-1 \\
& =c-\frac{1}{2}(y_{1}-y_{2})^{2} \\
& =c-\frac{x^{2}}{2}
\end{aligned}$$

Thus,
$$f(x)=c-\frac{x^{2}}{2}, \quad x \in \mathbb{R}$$

Comparing (1) and (2), we get
$$c=1$$

Therefore,
$$f(x)=1-\frac{x^{2}}{2}, \quad x \in \mathbb{R}$$

Conversely, it is easy to verify that the function (3) satisfies the conditions of the problem. Therefore, the required function is