Example 3 Let $0 \leqslant x \leqslant \pi, 0 \leqslant y \leqslant 1$. Try to find the minimum value of the function
$$
f(x, y)=(2 y-1) \sin x+(1-y) \sin (1-y) x
$$
It is known that for all $0 \leqslant x \leqslant \pi$, we have
$$
\sin x \geqslant 0, \sin (1-y) x \geqslant 0 \text {. }
$$

Thus, when $\frac{1}{2} \leqslant y \leqslant 1$, $f(x, y) \geqslant 0$, and the equality holds when $x=0$.
When $0 \leqslant yx>\sin x$,

and $\sin (x+\delta)=\sin x \cdot \cos \delta+\cos x \cdot \sin \delta$
$\leqslant \sin x+\delta \cos x$.
Therefore, $\frac{\sin x}{x}-\frac{\sin (x+\delta)}{x+\delta}$
$=\frac{(x+\delta) \sin x-x \sin (x+\delta)}{x(x+\delta)}$
$\geqslant \frac{(x+\delta) \sin x-x(\sin x+\delta \cos x)}{x(x+\delta)}$
$=\frac{\delta \sin x-\delta x \cos x}{x(x+\delta)}=\frac{\delta \cos x(\tan x-x)}{x(x+\delta)}$
$>0$.
Hence, the function $f(x)=\frac{\sin x}{x}$ is decreasing on $\left(0, \frac{\pi}{2}\right)$.
Since $g(x)=\sin x$ is decreasing on $\left[\frac{\pi}{2}, \pi\right]$, it follows that $f(x)=\frac{\sin x}{x}$ is also decreasing on $\left[\frac{\pi}{2}, \pi\right]$.
Moreover, $00$,
then $\frac{\sin (1-y) x}{1-y} \leqslant \frac{1-y}{1-2 y} \sin (1-y) x$,
$\sin x \leqslant \frac{1-y}{1-2 y} \sin (1-y) x$.
Thus, $(2 y-1) \sin x+(1-y) \sin (1-y) x \geqslant 0$,

which means $f(x, y) \geqslant 0$.
When $y=0$, the equality holds.
In summary, when $x=0$ or $y=0$,
$$
f(x, y)_{\min }=0 \text {. }
$$

Note: The monotonicity of the function $f(x)=\frac{\sin x}{x}$ on $\left(0, \frac{\pi}{2}\right)$ can also be determined using the derivative method combined with $\tan x>x$, $x \in\left(0, \frac{\pi}{2}\right)$.