The second matrix in the definition of [tex]f[/tex] is singular, since
[tex]\sin(\pi) = -\cos\left(\dfrac\pi2\right) = \tan(\pi) = 0[/tex]
[tex]\cos\left(\theta+\dfrac\pi4\right) = \sin\left(\dfrac\pi2 - \left(\theta+\dfrac\pi4\right)\right) = \sin\left(\dfrac\pi4-\theta\right)=-\sin\left(\theta-\dfrac\pi4\right)[/tex]
[tex]\cot\left(\theta+\dfrac\pi4\right) = \tan\left(\dfrac\pi2 - \left(\theta+\dfrac\pi4\right)\right) = \tan\left(\dfrac\pi4 - \theta\right) = -\tan\left(\theta-\dfrac\pi4\right)[/tex]
[tex]\ln\left(\dfrac4\pi\right) = -\ln\left(\dfrac\pi4\right)[/tex]
In other words, it's antisymmetric; [tex]A^\top=-A[/tex]. It's easy to show that [tex]\det(A)=0[/tex] if [tex]A[/tex] is 3x3 and antisymmetric.
The other determinant reduces to
[tex]\begin{vmatrix}1 & \sin(\theta) & 1 \\ - \sin(\theta) & 1 & \sin(\theta) \\ -1 & -\sin(\theta) & 1 \end{vmatrix} = 2 + 2\sin^2(\theta)[/tex]
Hence
[tex]f(\theta) = 1 + \sin^2(\theta) \implies f\left(\dfrac\pi2\right) = 1 + \cos^2(\theta)[/tex]
With [tex]g[/tex] defined on [tex]\left[0,\frac\pi2\right][/tex], both [tex]\sin(\theta)[/tex] and [tex]\cos(\theta)[/tex] are non-negative. So
[tex]g(\theta) = \sqrt{f(\theta)-1} + \sqrt{f\left(\dfrac\pi2-\theta\right)-1} \\\\ ~~~~ = \sqrt{\sin^2(\theta)} + \sqrt{\cos^2(\theta)} \\\\ ~~~~ = |\sin(\theta)| + |\cos(\theta)| \\\\ ~~~~ = \sin(\theta) + \cos(\theta) \\\\ ~~~~ = \sqrt2\,\sin\left(\theta + \dfrac\pi4\right)[/tex]
which is maximized at [tex]t=\frac\pi4[/tex] with a value of [tex]\sqrt2\,\sin\left(\frac\pi2\right)=\sqrt2[/tex], and minimized at [tex]t=0[/tex] and [tex]t=\frac\pi2[/tex] with a value of [tex]\sqrt2\,\sin\left(\frac{3\pi}4\right)=1[/tex].
Edit: The rest of my answer wouldn't fit. Continued in attachment.