
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 $f(x)=2\sqrt{3}\cos\omega x\sin\omega x-2\cos^2\omega x+1$ ($\omega>0$), and the smallest positive period of $f(x)$ is $\pi$.  
$(1)$ Find $f(x)$;  
$(2)$ When $x\in[0,\frac{\pi}{2}]$, find the maximum and minimum values of the function $y=f(x)$ and the corresponding $x$ values.

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