Should students who copy homework answers from somewhere else state how they obtained the answer?
It is good to be honest in all that you do. You should, of course, ask your professor whether your "researches" are proper or not. I would treat asking someone on math.se for a solution to your exercise as improper, for example. 

The reason for that is that you don't learn the necessary lessons by reading a solution that you do by creating it. So it is mostly an educational issue, not an ethical one. But your instructor will give you the most useful advice. 

The professor hasn't asked you to solve a problem because he/she needs the solution. The question has been asked because solving the question will advance your  education and finding a solution will be much less effective at that. 

Education is about changing how your brain works. In mathematics, especially, you need to do your own work in order to cause the brain to reorganize itself to make advancement possible. 

Asking the instructor for help is better in this regard than asking someone else, say on math.SE. The reason is that the instructor can give you a hint that will help you advance, rather than a solution that won't. It may even be useful for  your instructor to know that you are struggling with some ideas. You may get advice that gets you past the block. Math.SE is very unlikely to do that. The answers you likely get there will be too helpful. 

Becoming a mathematician is about changes in your brain, not about proofs printed on paper.