Yes, if you are receiving radar services you must comply with ATC instructions. And contrary to voretaq's otherwise excellent answer, simply electing to terminate radar services so as to avoid those instructions or restrictions is not necessarily an option.
There are two reasons for this, one legal and one practical.
Let's look at 14 CFR 91.123 Compliance with ATC clearances and instructions. Paragraph (a) concerns ATC clearances. When you're on flight following you don't receive clearances except for practice approaches or Class B operations, so that doesn't really apply. But look at paragraph (b):
Except in an emergency, no person may operate an aircraft contrary to an ATC instruction in an area in which air traffic control is exercised.
That's pretty cut and dried. There are only two exceptions: 1) if an emergency exists or 2) if you're not in an area "in which air traffic control is exercised," i.e. uncontrolled (Class G) airspace. If you choose to call ATC and request radar services, and ATC issues an instruction, you must comply with that instruction. You can request to terminate radar services and change your frequency, but the controller is well within their rights to disallow termination. Note that when terminating radar services ATC will use the phraseology "frequency change approved" or "change to advisory frequency approved." This approval is not guaranteed!
(To counter the claim that "an area where air traffic control is exercised" means only Class B/C/D airspace, compare the wording in the AIM 4–3–2a vs 5–4–3a.)
Consider the reason you called ATC in the first place.
It might be that you wanted to transition certain airspace and being in two-way communication with ATC is a requirement to enter that airspace (B/C/D). In that case you will have to remain in contact with ATC and comply with any instructions they give in order to remain in the airspace.
But it might be that your route remains entirely within Class E airspace; communicating with ATC is not a requirement, but you decided to do so anyway. Why? To receive traffic information! You still have a legal responsibility to see and avoid other traffic, but because you are receiving radar services ATC will call traffic that may be a factor and thereby help you carry out this responsibility. If ATC issues an instruction or restriction, it is to keep you away from traffic you might be unable to see or avoid—we do not issue vectors for controller amusement.1 Any instruction you receive will be because the controller thinks it is necessary to ensure the safety of your flight. Why would you choose to discontinue this service exactly when it would be most helpful to you?
Certainly, as voretaq points out, you can query an instruction and suggest (or ask for) an alternative. But if the controller is unable to issue an alternative instruction, you must comply.
1Vectors for controller incompetence are another matter.