Pointwise and uniform convergence

I got stuck on two problems that involves finding the pointwisse limits of piecewise functions. Hope someone can give me a hand.

1) Let be a sequence that contains each rational in [0,1] precisely once. For each , define

if x is irrational

if

if

Prove that converges pointwise on [0,1] to a function that is not R-integrable.

My attempt:

I guess that this sequence of functions converges to the rational characteristic function, but I can't really show as n approaches infinity.

I tried this again and I got this far: if x is irrational and if x is rational.

Consider: absolute value of = if x is irrational. Choose

If x is rational, . I think f(x)=1 because eventually as n approaches infinity.

2) For define by if and if . Prove that does not converge uniformly on [0,1] but converge uniformly on [M,1] where 0<M<1.

I don't know what the pointwise limit of , so I can't go any anywhere. (Crying) It would be really helpful if someone helps me how to find the pointwise limit