For starters, I wouldn't say that he was "unphased" by Sarah's shotgun rounds - he recoils, halts for a second, then continues his slow advance towards her. This is not consistent with his much more dramatic response to the 9mm rounds fired by the T-800 earlier in the movie. We can only speculate about why he reacts so differently, and why a much larger round causes less of a reaction than a much smaller round.
As for the question of why the T-800's fist went straight through the T-1000's head, I have always assumed it did so because the T-1000 wanted it to. He turned a strong attack against him to his advantage by using it as a chance to grab his opponent's hand, spin him around, and launch a counterattack. It was a brilliant maneuver, and it worked out better than he had probably anticipated.
The suggestion that he was malfunctioning by this point doesn't hold up, in my opinion. Just before the head-punch, he is thrown against a wall, and instantly liquifies, then reforms with his body pointed the opposite way (he hit the wall face first, and a second later his back is to the wall and he is facing the T-800 again. I think he had suffered some degree of cumulative damage (after he is frozen, shattered, and reassembled, we see a ripple course upwards through his body, which I interpret as some sort of glitch), but not enough to significantly impair his functionality.
Yes, he is knocked back by bullets, but we never see him being shot while he is in his liquid form. I suspect that shooting T-1000 while he was liquid would be useless and the bullets would pass right through him. We don't know, however, because every time we see him being shot, he is in solid form.
The short answer is basically as follows: As a previous answer points out, a giant robot fist imparts far more force than a measly little bullet. T-1000 didn't want to endure that amount of force if he could avoid it, and he wanted to gain the initiative in the fight, so he very cleverly allowed the fist to pass through his head without doing any damage, then exploited the fact that the T-800 was now off balance by grabbing his arm and whirling him around. It was simply what the T-1000 chose to do, and it worked out very well for him. He regained the upper hand, and temporarily incapacitated his opponent as a result. He is just a very skilled combatant.