it is helpful the think of the quantity |x-a| as "the distance between x and a".

so |x-a| < |x-b| means "x is closer to a than it is to b". for which real numbers can this be true for, given that a < b?

for example, if a = 3, and b = 5, then |x - 3| < |x - 5| means x is closer to 3 than it is to 5. this is true for 3.5, it is not true for 6. can you generalize?

for the second problem, a function f is periodic if there exists a number a such that f(x) = f(x + ka) for any integer k, and for all x.

clearly the function shown repeats every 1/2, every 1/3, every 1/4, etc.....is there a smallest such period?