My cat is usually calm and well behaved. He usually just ignores everyone and isn’t that affectionate but recently he started to be nicer and even nudged his head against me for pets.I thought it was different since he usually isn’t like that but when petting him for a while he just bit me and wouldn’t let go. Whilst that he was meowing as if he was hurt but I checked and he wasn’t. It was like when touching a harmed cat and they go to bite but stop because they no better and don’t really want to hurt you.
This change of behavior can indicate that your cat isn't feeling well. He might have asked for pets to comfort him and he might have bitten you because you caused him pain without realizing it.
You should make an appointment at a vet to get his health checked. Tell the vet all of the changes you noticed. They know best what tests to do.