Devraj Tamil Selvan, 29, pleaded guilty to one count each of using criminal force and abusive behaviour towards a police officer, as well as one charge of using abusive words at two officers.
He also admitted to illegally riding a motorcycle in August last year, for which he will be disqualified from driving for three years after his release from prison.
Ten other charges were taken into consideration during his sentencing.
On Sept 13 last year, three police officers responded to a call for assistance at a Choa Chu Kang flat where Devraj lived. The caller had alleged that a person in the flat was "using violence".
The officers later arrested Devraj after he slapped his girlfriend - who is not named in court documents - in their presence
He later used his body to push against one of the officers as he was being escorted to the police car.
Inside the vehicle, Devraj claimed that he could not breathe properly.
An ambulance was called and he was taken to Ng Teng Fong General Hospital for further assessment.
Devraj later removed his mask and deliberately coughed several times at the police officer he had earlier pushed, despite multiple warnings by the officers and the hospital staff.
He also verbally abused two police officers.
The court also heard that Devraj rode his motorcycle from Choa Chu Kang to Jurong on Aug 12 last year, despite having been disqualified from driving all classes of vehicles for the period between Jan 17, 2019, and July 16 this year.
For using criminal force on a police officer, Devraj could have been jailed for up to four years, or fined, or both.