This is my attempt to solve the problem:

Since Y acts like some "switch", I considered two independant distributions of X given Y: p = 1/5 on [0,5] (for Y = 0) and the other one p = 1/5 on [4,9] (for Y = 1). So two means are: 2.5 (for Y = 0) and 7.5 for (for Y = 1).

For P(Y = 1|X = x):

if X in [0, 4]: P(Y = 1|X = x) = 0

if X in [5, 9]: P(Y = 1|X = x) = 1

if X in [4, 5]: P(Y = 1|X = x) = 0.5

for this "What is the minimum probability of rejection to predict Y from X without mistake." I have no idea.