
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) = A\sin(\omega x + \varphi)$ $(A > 0, \omega > 0, |\varphi| < \frac{\pi}{2})$, the graph of this function passes through point C $\left(\frac{3\pi}{8}, 0\right)$. The highest point adjacent to point C on the graph is D $\left(\frac{\pi}{8}, 2\right)$.  
(1) Find the analytic expression for $f(x)$.  
(2) Find the maximum and minimum values of the function $f(x)$ in the interval $\left[-\frac{\pi}{4}, \frac{\pi}{4}\right]$ and the corresponding values of the variable $x$.

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