Hard to decide dump it or bottle it because so little information provided.
How do you know its infected?
What are the flavors you are getting?
How did the fermentation go? What temps you ferment at? What yeast did you use?
What style of beer is it? What is the malt bill?
Do you star san or some other sanitizer?
I recently made a pale ale that just tasted off, I couldn't decide what the problem was,
I added gelatin, let it age a while and it still didn't taste good.
I went back over my recipe notes and realized the beer was supposed to be dry hopped.
After 10 days of dry hop, it came out pretty good.
So if you can describe the off flavors and provide more information, I'm sure someone here can help with your problem.