You may try replacing the cassette without replacing the chain, but check your chain carefully for damaged links and stretch. A new chain can be used on an older cassette with no negative consequences, but the reverse isn't true.
Unless your chain is relatively new and in excellent condition it might make financial sense to replace it also. If it's worn (stretched) beyond about 20-30% of it's life (more than 1/64" it'll rapidly wear the cassette to it's own relative age, costing you valuable cassette life.
Comparing the cost of that wasted cassette life to the cost of replacing a chain, it's often cheaper to spend the extra $$$ now. Not to mention that it'll run smoother too.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.