Not sure why you would get a shot of a single vitamin - it makes no sense from a food science standpoint as vitamins don't work in isolation. A lot of people used to suggest B12 for fatigue but it's really gone out of favor in most circles.
Any injection can cause an infection if things were not sterile or if the solution was contaminated, but it sounds like you had something going on beforehand. There have been some news stories about faulty pharma compounding firms (one in Massachusetts has been closed down because a lot of people got sick) so it's important to notify a doctor and find out the cause. If there is suspicion about the shot, you should have the lot number of the B12 traced and reported to the Board of Health in your town or, better, the state Department of Public Health.
However, the fact that you were always cold is a clue that perhaps your immune system wasn't up to par, and then you came down with something. But the swollen (?) painful breasts are an indicator - if it's not related to your cycle (which is perfectly normal) and if you're not pregnant (take another test to be sure or have the doctor do one), then there could be something else going on.
So, as others have said, get checked out.