A: This is a great question!
Let's start by establishing the biblical facts related to this issue.
Fact #1: God's Holy Spirit in the life of a believer is referred to as a "gift." (See Acts 2:38 and 10:45)
Fact #2: God's gifts are not revoked. (See Romans 11:29)
So, this should mean that God's Spirit is not revoked in the life of a believer, even if we endure a period of backsliding.
"But wait!"—someone will say, "then why did David plead with God not to remove His Holy Spirit?" They would be referring to David's prayer of repentance in Psalm 51.
Cast me not away from your presence, and take not your Holy Spirit from me. Psalm 51:11 (ESV)
That passage sure makes it sound like God does remove His Spirit in cases of disobedience. David was concerned enough to ask the Lord not to do it.
But remember that David was living under a different dispensation of the Spirit than are we today. For example, in David's day the Holy Spirit did not indwell a believer. He only came upon an individual to anoint and empower for service. Under the new covenant the Holy Spirit comes not only upon but also in—to live inside or indwell. And since the facts stated above are made under the new covenant, it is our conclusion is that the gift of God's Holy Spirit will not be revoked due to disobedience.