You have defined a local variable correctflag with this line in
String correctFlag = flags[num.Next(0, flags.Length)];
in
public void RandomImage()
.
This is not the same as assigning a value to
private string correctFlag { get; set; }
Learn about
Scope of Variables in C#[
^].
Change that first line to be
correctFlag = flags[num.Next(0, flags.Length)];
and while you are about it change the declaration for the random button function to
public void RandomButttons(string flag2, string flag3, string flag4)