I began searching in the zoology section. But I didn't find what I wanted. [...], I shifted to veterinary medicine.
I think using giving up would mean giving up on the whole thing. It doesn't imply change.
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
I didn't find what I wanted in the zoology section, so I began diverging into veterinary medicine.
di·verge, dəˈvərj, dīˈvərj/ verb:
(of a road, route, or line) separate from another route, especially a main one, and go in a different direction; deviate from a set course or standard; develop in a different direction. -Google
When a search appears unproductive, I'll retarget my efforts with different keyword or discipline emphasis. collinsdictionary:
to target again or differently
A lower pound would help retarget inflation and transfer spending power from consumers to producers. Glasgow Herald (2002)
In fact, towards the end, Misra agreed with the need to liberalise agriculture, and was even convinced of the need to retarget subsidies. Business Today (1998)
I think the most common word in English to describe your state would be undaunted. In common usage today, it means what @FumbleFingers describes above: you've recognized that your current approach is not working, but are refusing to concede defeat and will try again (presumably using another tack, in your case).
Note that undaunted does not have the sort of "giving up" or even the "changing approach" part of your meaning itself but rather the "continuing despite initial failure" part. The continuance of your sentence ("I shifted to veterinary medicine") is what actually describes the change and informs the reader that you are going to change tack in your next foray.
On the other hand, if you want the phrase to emphasize the sense of doing something different (giving up on your first approach) rather than the perseverance, I'd probably use either changing tack, or more commonly, shifting gears.