The correct answer is: B. To quarrel over trifles.

To wrangle over an ass's shadow means to argue or fight over something that is not important. It is a metaphor for arguing over something that is not worth the effort.

Option A is incorrect because it does not accurately describe the meaning of the phrase. To act in a foolish way can mean many things, but it does not necessarily mean to argue or fight over something that is not important.

Option C is incorrect because it does not accurately describe the meaning of the phrase. To waste time on petty things can mean many things, but it does not necessarily mean to argue or fight over something that is not important.

Option D is incorrect because it does not accurately describe the meaning of the phrase. To do something funny can mean many things, but it does not necessarily mean to argue or fight over something that is not important.