
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 functions $f(x)=x-m\ln x-\frac{m-1}{x}$ $(m\in\mathbb{R})$ and $g(x)=\frac{1}{2}x^{2}+e^{x}-xe^{x}$,
(1) Find the minimum value of $f(x)$ when $x\in[1,e]$,
(2) When $m\leqslant 2$, if there exists $x_{1}\in[e,e^{2}]$ such that for any $x_{2}\in[-2,0]$, $f(x_{1})\leqslant g(x_{2})$ holds, find the range of the real number $m$.

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