Daniel B. answered 12/04/20
A retired computer professional to teach math, physics
In the absence of a concrete example, let me give you a general answer.
Consider each "piece", i.e., each interval of the domain separately.
For each interval, minima and maxima can occur at
- the ends of the interval,
- at points where the function is not differentiable,
- at points where the derivative is 0.
Then you can compare all the above candidates for minima and maxima among all the intervals.