I'm trying to change RGB color in GIMP, simple open "Change Foreground Color" and setting new RGB values, but when I set the number in the R field the color become purple, why is this?
You have tried to take a color which is impossible to show in RGB. GIMP has at least a possiblity to select impossible to display colors by Lightness-Chroma-Hue. LCH easily allows combinations which are undisplayable in RGB monitors (=need RGB numbers beyond the available range 0....255) Those combinations are shown as bright magenta.
Reduce Chroma (=colorfulness, =deviation from grayscale) to displayable range. (=activate LCH sliders instead of HSV and decrease C). See, how the RGB numbers become to allowed range. Maximum available chroma is possible for pure R, G or B, mixed colors must have less.