26. Find the minimum value of the function $f(x)=|\sin x+\cos x+\tan x+\cot x+\sec x+\csc x|, x \in \mathbf{R}$.
26. Let $t=\sin x+\cos x$, then $t \in[-\sqrt{2}, \sqrt{2}]$ and $t \neq \pm 1$.

And $\sin x \cos x=\frac{(\sin x+\cos x)^{2}-\sin ^{2} x-\cos ^{2} x}{2}=\frac{t^{2}-1}{2}$
Thus, $f(x)=\left|\sin x+\cos x+\frac{1}{\sin x \cos x}+\frac{\sin x+\cos x}{\sin x \cos x}\right|$
$=\left|t+\frac{1+t}{\frac{t^{2}-1}{2}}\right|=\left|t+\frac{2}{t-1}\right|$
$=\left|(t-1)+\frac{2}{t-1}+1\right|$

Since $t-1 \in[-\sqrt{2}-1, \sqrt{2}-1]$ and $t-1 \neq-2,0$. Then
$$
\left|(t-1)+\frac{2}{t-1}+1\right| \geqslant\left|-2 \sqrt{(t-1) \cdot \frac{2}{t-1}}+1\right|=|1-2 \sqrt{2}|=2 \sqrt{2}-1 \text {, }
$$

when and only when $t-1=-\sqrt{2}$, i.e., $t=1-\sqrt{2}$, the equality holds.
Therefore, the minimum value of the function $f(x)$ is $2 \sqrt{2}-1$.