
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given the function $f(x)= \sqrt{3}\sin x\sin \left(x+ \frac{\pi}{2}\right)+\cos^{2}x- \frac{1}{2}$.

$(1)$ Find the intervals of monotonic decrease for the function $f(x)$;

$(2)$ Find the range of the function $f(x)$ on the interval $\left[0, \frac{\pi}{2} \right]$;

$(3)$ If every point's x-coordinate on the graph of the function $f(x)$ is stretched to twice its original value (the y-coordinate remains unchanged), and then the resulting graph is shifted to the left by $\varphi (\varphi > 0)$ units to get the graph of the function $g(x)$, and if $g(x)$ is an odd function, find the minimum value of $\varphi$.

Present the answer in LaTex format: \boxed{Your answer}
user