Not much help can be offered from your brief description, alas.
Play a Rogue or a Barbarian or a Fighter; you wouldn't need magic to do your thing. (Since you will have to solve mysteries, Rogue might be the best choice.)
Heavy math solution (so have a high INT): a Wizard with cantrips can walk around and try to use a cantrip. Walk in a straight line away from town and try every so often until the spell works. Plot your position on a map. Repeat with roads going different directions. The points on the map should resemble a circle. Whatever is causing the problem is near the center of the circle.
Now you need to skulk around and gather information. What buildings are where? Can you see in the windows? Is any place guarded / protected?
You also need to talk to the townspeople to collect information. (Are there newly-arrived strangers? They might have brought the problem with them.)
When you know more you can begin to draft a plan to defeat the enemy.
And keep us posted, maybe we can help more.