A function can be analytic only inside a circle. For example the function $g(z)= 1+z+z^2+...$ is only analytic inside the unit circle and nowhere else. This example can be modified to fit into any other circle.
Similarly,
Is it possible that a function is only analytic inside a rectangular strip?
What about any general curves?