The first thing is
x<2 and x>4 cannot be the solutions.
Think of this examples:
If x<2, take a point x=1
then (x-2)(x-4)
=(1-2)(1-4)
=(-1)x(-3)=3
which is actually greater than 0 and not equal to 0. This contradicts the condition.
If x>4, take x=5
(5-2)(5-4)=3x1=3
which is again greater than 0 and not equal to 0
This too contradicts
The correct answer is
x≥2 and x≤4
therefore x belongs to [2,4]
Now if you check this:
We already know when x=2 or x=4 the product is 0 which is a solution.
Now take a point between 2 and 4, x=3
(3-2)(3-4)=1x(-1)=-1
which is less than 0
Hope you understood
Thank you