4. Given that $x$ is an acute angle. Then $\sin ^{3} x+\cos ^{3} x=\frac{\sqrt{2}}{2}$ is a ( ) for $x=\frac{\pi}{4$.
(A) sufficient but not necessary condition
(B) necessary but not sufficient condition
(C) sufficient and necessary condition
(D) neither sufficient nor necessary condition
4. (C).

Solution 1: Necessity.
Take $x=\frac{\pi}{4}$, then we have
$$
\left(\sin \frac{\pi}{4}\right)^{3}+\left(\cos \frac{\pi}{4}\right)^{3}=2\left(\frac{\sqrt{2}}{2}\right)^{3}=\frac{\sqrt{2}}{2} \text {. }
$$

Sufficiency.
By the three-dimensional mean inequality, we have
$$
\begin{array}{l}
\sqrt{2} \sin ^{3} x+\sqrt{2} \sin ^{3} x+\frac{1}{2} \geqslant 3 \sin ^{2} x, \\
\sqrt{2} \cos ^{3} x+\sqrt{2} \cos ^{3} x+\frac{1}{2} \geqslant 3 \cos ^{2} x .
\end{array}
$$
Adding the left and right sides of (1) and (2) respectively,
$$
\begin{aligned}
\text { Left side } & =2 \sqrt{2}\left(\sin ^{3} x+\cos ^{3} x\right)+1 \\
& =2 \sqrt{2} \times \frac{\sqrt{2}}{2}+1=3,
\end{aligned}
$$

Right side $=3\left(\sin ^{2} x+\cos ^{2} x\right)=3$.
This shows that (1) and (2) both take equality, so we have
$$
\left\{\begin{array} { l } 
{ \sqrt { 2 } \operatorname { s i n } ^ { 3 } x = \frac { 1 } { 2 } , } \\
{ \sqrt { 2 } \operatorname { c o s } ^ { 3 } x = \frac { 1 } { 2 } , }
\end{array} \text { which gives } \left\{\begin{array}{l}
\sin x=\frac{\sqrt{2}}{2}, \\
\cos x=\frac{\sqrt{2}}{2} .
\end{array}\right.\right.
$$

Since $x$ is an acute angle, hence $x=\frac{\pi}{4}$.
Solution 2: Solving the equation to find the unique solution $x=\frac{\pi}{4}$ can determine the necessary and sufficient condition. From $\sin ^{3} x+\cos ^{3} x=\frac{\sqrt{2}}{2}$, we have
$$
(\sin x+\cos x)(1-\sin x \cos x)=\frac{\sqrt{2}}{2} \text {. }
$$

Let $t=\sin x+\cos x$, then $1 \leqslant t \leqslant \sqrt{2}$, and
$$
\begin{array}{l}
t\left(1-\frac{t^{2}-1}{2}\right)=\frac{\sqrt{2}}{2} . \\
\therefore t^{3}-3 t+\sqrt{2}=0 .
\end{array}
$$

Solving, we get $t_{1}=\sqrt{2}, t_{2,3}=\frac{-\sqrt{2} \pm \sqrt{6}}{2}<1$ (discard).
Thus, only $\sin x+\cos x=\sqrt{2}$, which gives
$\sin \left(x+\frac{\pi}{4}\right)=1$. Hence $x+\frac{\pi}{4}=\frac{\pi}{2}, x=\frac{\pi}{4}$.
Therefore, the condition is both necessary and sufficient.