Regulus Arcturus Black was a genius who figured out the existence of Voldemort's Horcruxes before anybody else. The question is how? Also which era did he live in? Maybe it happened that he was one of the boys at Slughorn's party when Tom Riddle was told about the Horcruxes? Then he might have overheard...?
You have several questions here, so I’ll answer them separately.
How did Regulus know about the horcrux?
Regulus definitely knew that Voldemort was using at least one horcrux, for his note includes the line “I have stolen the real Horcrux”.
The question of how he knew about this was partially addressed by JK Rowling in an interview:
James Farrell: Voldemort never told anyone about his horcruxes, so how did Regulus Black discover his secret?
JKR: Horcrux magic was not Voldemort’s own invention; as is established in the story, other wizards had done it, though never gone as far as to make six.
Voldemort dropped oblique hints; in his arrogance, he did not believe anybody would be clever enough to understand them.
(He does so in the graveyard of Little Hangleton, in front of Harry). He did this before Regulus and Regulus guessed, correctly, what it was that made Voldemort so convinced he could not die.
We know Regulus volunteered Kreacher to help Voldemort place the locket horcrux. Although Kreacher didn’t know what it was, it would tell Regulus that Voldemort had something that needed hiding, which he was secret keeping from the Death Eaters. Kreacher says that Regulus was “very worried, very worried” when he learnt about the cave, the basin and the locket, so this probably played into his suspicions of horcruxes.
Combine this with carelessness on Voldemort’s part, and he was apparently able to work out that Voldemort was using a horcrux, and that the locket was a horcrux.
Horcrux, or horcruxes?
As @Mooz highlights in the comments, it’s unclear if Regulus knew that multiple horcruxes were in play. (JK Rowling doesn’t correct the interviewer above, but that doesn’t really tell us anything.)
But we get this rather telling line in the graveyard:
“I, who have gone further than anybody along the path that leads to immortality. You know my goal – to conquer death.”
— Goblet of Fire, chapter 33, The Death Eaters
Later, Dumbledore interprets this line as explicitly referring to multiple horcruxes.
“I who have gone further than anybody along the path that leads to immortality.” That was what you told me he said. “Further than anybody!” And I thought I knew what that meant, though the Death Eaters did not. He was referring to his Horcruxes, Horcruxes in the plural, Harry, which I don’t believe any other wizard has ever had.
— Half-Blood Prince, chapter 23, Horcruxes
It’s not inconceivable that he made a similar slip-up in Regulus’s hearing, and that Regulus reached the same conclusion.
When was Regulus alive?
I think this is tangential to the question, because it’s chasing the theory that Regulus and Voldemort attended school together. But hey, whatever. We can date Regulus from his appearance on the Black family tree:
Sirius jabbed a finger at the very bottom of the tree, at the name Regulus Black. A date of death (some fifteen years previously) followed the date of birth.
— Order of the Phoenix, chapter 6, The Noble and Most Ancient House of Black
This scene takes place in the summer of 1995, so he died sometime around 1980. (The HP Wiki puts this in 1979, but don’t explain this particular choice of year.)
We also know he signed up at sixteen, retrieved the locket aged seventeen, and died shortly afterwards. From Kreacher:
“For years he talked of the Dark Lord, who was going to bring the wizards out of hiding to rule the Muggles and the Muggle-borns… and when he was sixteen years old, Master Regulus joined the Dark Lord. So proud, so proud, so happy to serve…”
“And one day, a year after he had joined, Master Regulus came down to the kitchen to see Kreacher.”
— Deathly Hallows, chapter 10, Kreacher's Tale
This means he was born around the early 1960s. Voldemort attended Hogwarts fifty years before 1992 (the first/second opening of the Chamber of Secrets), in the late 1930s/early 1940s, so they would never have overlapped.
So he would never have heard of the horcruxes while at school with Voldemort (and besides, note that Tom Riddle waited until he was alone with Slughorn before asking about them).
R.A.B is Regulus Arcturus Black, the younger brother of Harry's godfather, Sirius Black. He would have attended Hogwarts at roughly the same time as Harry's parents, the rest of the Marauders, and Severus Snape. That's well after Tom Riddle had left the school, so he wouldn't have overheard anything in any Slug Club meetings that the young Voldemort attended.
As explained by Kreacher at the start of Deathly Hallows Regulus offered Kreacher to Voldemort to test the defences around the locket Horcrux in the cave. I suspect much of what he knew about the locket came directly from Kreacher's account of the cave and the powerful magical defences that Voldemort was placing there.
I don't think he knew much, if anything, about Horcruxes. From everything that's said about Reglus in the books he didn't seem to be a Death Eater with the status of somebody like Lucius Malfoy, and Voldemort didn't even tell Lucius what the Diary was when he asked him to keep it safe. I think, in the end, he simply had a change of heart, wanted a way to get back at Voldemort, and knew that the locket was incredibly important to him, even if he didn't know exactly why.
Voldemort was very arrogant and believed that he alone knew everything about magic and never suspected that another person might deduce that he had made Horcruxes. However, just like how he thought that only he knew about the Room of Hidden Things/Room of Requirement, he was wrong on this count too.