Festival to Janus, god of gates and doorways. There seem to be many different legends about the history of Janus. One has him the son of Uranus and Hecate. Another says he had a son named Tiberinus whose accidental drowning named Roma's river. According to another he was a son of Apollo and the first king of Latium. His colony near the Tiber is supposed to have given the name to the Janiculum Hill. Another story says that Janus welcomed Saturn to earth after the latter was driven out of Olympia by Zeus.
Janus was very important in Rome because the weakest point in any building or municipality is its doorway. Anything from human enemies to evil spirits could enter via that route. So strong was this feeling that Romans always carried corpses out of buildings feet first so that the departed spirits would be less likely to find their way back in.
In 260 BC the Romans built an important gateway temple to Janus after a victory against the previously unbeatable Carthaginian fleet. This was left open in times of war and closed when the armies had returned to the city.
This seems puzzling since one would think that during war the gate would be closed for protection and left open for peacetime. But the meaning of this can be seen in that the gateway was not used on a regular basis, but only for generals marching out to war and when returning in a triumphal procession. During the time the gateway was open, Janus was out fighting for Rome while when it was closed it meant that the god would not abandon Rome.
Januarius was not always the first month of the year. Earlier it had begun, perhaps more sensibly, in March (Martius) with the onset of Spring. Januarius and Februarius were added by Numa Pompilius, one of Rome's kings in the pre-Republic days. He also moved the beginning of the year to Januarius and set the number of days equal to 29 because Romans considered odd numbers lucky. Notice that all of the festivals are held on odd-numbered days. Centuries later Julius Caesar set the length to 31, as well as adding days elsewhere to fix the problem of the months no longer corresponding to the seasons, a result of the fact that the Roman year was shorter than the actual solar year.
If the first month is seen as the gateway to a new year, naming it after Janus (the -ary means "pertaining to") actually makes sense. His most common depiction is of a head with two faces, one looking back, the other forward.