What Tony is injecting are the Subcutaneous Implants for controlling Mark 42, otherwise known as:
JARVIS: Mark 42, inbound.
Tony: I'll be damned. The prodigal son returns.
Source: Springfield! Springfield@ - Iron Man 3
The Mark 42 also features the unique ability to control itself when Tony Stark isn't inside his suit or when Mark 42 is A.I-deactivated. The Subcutaneous Implant in Tony's forearms allow the armor to communicate with his nervous system helping the armor follow his commands. Any action done by Stark is imitated by Mark 42 if he connects with it.
Source: Mark 42 > Armor Capabilities > Subcutaneous Implants
we see the Mark 42 in the workshop at the start of the film and after injecting himself we see him try to put on the suit.
where the wiki says it imitates tony's actions we know it does more than that as Tony used it to fool Pepper that he was wearing the suit sitting in the lounge when really he was still in his workshop working on stuff and when they are sleeping the Mark 42 enters the room and looks as if it's about to attack Pepper before Tony takes up, commands it to power down and then does a sorta sword slash motion which causes it to fall into the individual components.
so despite The Subcutaneous Implant being in his arms it seems to also be tied mentally to him and can react to certain moves by Tony (which as the sword cutting move he did in bed)
Is it ever explained, either in the movie or the comic book source, what he's injecting, and why he needed to rub it to get it to work?
i'm not sure where it's referenced to outside the wiki but according to This Quora question on the same topic
[the Subcutaneous Implants is] the equivalent of what "Extremis" was in the comic storyline.
so chances are the comic fans worked this out
In regards to the rubbing, he's more cleaning his arm of from what i assume is blood after the injections, as for the sorta tapping/slapping either it's either
- sorta moving the implant(s) around to spread them out a bit more
- he's trying to mask the pain. we see him saying "owe" when J.A.R.V.I.S is counting and J.A.R.V.I.S stopped counting at 47 and i think Tony does 2 more. so he injected himself like 49 times and they don't seem painless.