
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
Let the function $f(x)=\sin^2(x+\pi)-\cos^2(x- \frac{\pi}{3})$.

$(1)$ Find the smallest positive period of $f(x)$ and the intervals where it is monotonically increasing;

$(2)$ If $|f(x)-m|\leqslant 2$ holds true for all $x\in\left[- \frac{\pi}{6}, \frac{\pi}{4}\right]$, find the range of the real number $m$.

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