God said to Yaakov: “Rise and go up to Beit El and dwell there, and make there an altar to the God who appeared to you when you fled Esav your brother.”
Yaakov said to his household: “Remove the foreign gods that are among you, and purify yourselves, and change your clothes.” (35:1-2)
How is it possible that among Yaakov's family some people chose to have idols? That Yaakov suspected or knew about them previously, but only now told his family to discard them? That he did not express any anger at the thought his family members might be worshiping idols?
(These are theological problems, but are equally textual problems, since in other places the text presents Yaakov as exclusively devoted to God, and the examples of Avraham and Yitzchak suggest that Yaakov would not tolerate such deviation in his family.)
I think the answers can be found by looking at Parshat Matot.
There, the Jewish people sends an army to fight Midyan. They kill a bunch of people, and return with spoils – both human and material. Moshe then commands them as follows:
“Park yourselves outside the camp seven days, whoever killed a person and whoever touched a corpse, and purify yourselves on the third and seventh days – you and your captives. And every garment, and every leather garment, and every goat fabric, and every wood utensil – you shall purify.” (Bamidbar 31:19-20)
The story there includes the following elements (among others):
1) A bloody war
2) The taking of spoils
3) Purification of people
4) Purification of clothing
Now looking at Yaakov's story, it includes the same four elements:
1) A bloody war – Yaakov's command is right after the Shechem/Dina slaughter (Breishit 34)
2) The taking of spoils: “That which was in the city, and that which was in the field, they [Yaakov's sons] took.” (34:28)
3) Purification of people: “purify yourselves” (35:2)
4) Purification of clothing: “and change your clothes (35:2)
It seems that the whole purification thing was simply the same purification that Moshe's warriors underwent after the war (maybe the technical details differed, since the Torah wasn't given yet). Similarly, it seems there is an obvious and non-controversial source for the idols. If Yaakov's sons really took everything from the city as spoils, as the verse seems to say, surely idols were among the spoils. There is no need to assume that Yaakov's family possessed idols before the war.
The Torah later commands that we destroy captured idols:
“The idols of their gods you shall burn in fire. You shall not appropriate silver and gold from them, and take for yourself – lest you be ensnared by it [by worshiping them]” (Devarim 7:25)
It warns specifically against silver and gold idols, since people will naturally want to hold on to that wealth, even if they don't plan to worship the idols. Yaakov didn't fault his sons too much for wanting the gold and silver. But because the presence of idols is incompatible with building an altar in Beit-El and worshiping God there, Yaakov still had to tell his sons to get rid of the idols.