
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(wx+\phi)$ ($A > 0$, $w > 0$) has a maximum point at $\left(\frac{\pi}{2}, \sqrt{2}\right)$, and the curve from this point to the adjacent minimum point intersects the $x$-axis at $\left(\frac{3\pi}{2}, 0\right)$. If $\phi \in \left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$.

$(1)$ Find the expression for $f(x)$.

$(2)$ Find the range of $f(x)$ on $\left[0, \pi\right]$.

$(3)$ If for any real number $x$, the inequality $\left| f(x)-m \right| < 2$ always holds on $\left[0, \pi\right]$, find the range of the real number $m$.

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