$\sin x + \cos x = \min\{1, k^2-4k+6, k \in \mathbb{R}\}$
I assume that the question looks for the minimum of the two.
Thus, $\sin x + \cos x = \min(1,2)= 1$
$\implies \sin\Big(\dfrac x 2 \Big)\cos\Big(\dfrac x 2\Big)= \sin^2 \Big(\dfrac x2\Big) $. On solving we get, $x = 2n\pi$ or $x= 2n\pi + \dfrac\pi2$ , $n \in \mathbb{I}$.
However, answer given is $x = n\pi + (-1)^n\dfrac \pi 4 - \dfrac \pi 4$.
Where have I gone wrong?
Method$\#1:$,
For $x = n\pi + (-1)^n\dfrac \pi 4 - \dfrac \pi 4$
if $n$ is even, $=2m$(say) where $m$ is any integer $$x=2m\pi$$
What if $n$ is odd, $=2m+1$(say) where $m$ is any integer ?
So, the answer is a compact form of what you have reached at.
Method$\#2:$,
$$\sin x+\cos x=1\iff\sin\left(x+\dfrac\pi4\right)=\sin\dfrac\pi4$$
See general solution here.
Method$\#3:$,
$$\sin x+\cos x=1\iff\cos\left(x-\dfrac\pi4\right)=\cos\dfrac\pi4$$