If a rare candy is given to level 100 what will happen
Nothing would happen unless the Pokemon is level 99 or lower. Since level 100 is the maximum level you can't make it higher even with the Lumoise Juice Shoppe you can't. Pretty much meaning nothing will happen.
Source:I tried it in my X game
Also you won't lose it.
You cannot give a level 100 Pokemon a rare candy. It will simply say 'It won't affect it' or something of that sort.
Answer: Nothing will happen, your rare candy will not be used.
Source: Experience
It won't have any effect.