#color(blue)("Comment")#
The way to depict repeating parts of a decimal is to but a bar over the part that repeats.
so #5.142142142.... -> 5.bar142# or some variation on it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#color(blue)("Solution to part A")#
Set #x=0.212121 .......Equation(1)#
Then
#100x=21.212121 ....Equation(2)#
#Equation(2)-Equation(1)# gives
#100x-x=21#
#x(100-1)=21#
#99x=21#
#x=21/99#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#color(blue)("Solution to part B")#
Set #x=5.142142142 ......Equation(1)#
Then
#1000x=5142.142142142 .....Equation(2)#
#Equation(2)-Equation(1)#
#1000x-x=5137#
#x(1000-1)=5137#
#x=5137/999#