I've started to learn math not that long ago, what I actually must have been doing at school, but never mind.
Solving exercises, I ask myself pretty often, if I'm right making my final conclusions, proving a theorem. Of course, I haven't faced yet with something really hard to solve. Currently I'm not gonna ask about proofs for any type of exercises, but rather about my specific case I've faced with.
Just today I solved the next exercise:
Prove that for any natural value of "n"(not equal to 1), the result of the expression $(n^4 + n^2 + 1)$ is a composite number.
Not without help, but I solved it, getting the next result $$(n^2 + n + 1)(n^2 - n + 1)$$
And here is the point. I've proved it just by substituting several random numbers in the place of "n" variable, getting the right result. And this seems to be such a lame and a wrong approach, because there are ∞ numbers, when I've tried just 3-5 of them. And that's it.
How can I make sure that my proofs are right, not by substituting numbers and not by making something unreliable like substituting, but by... I don't know even by why. I'm confused about that.
I hope you can advise me something and give me some tips, maybe explanations, because possibly I'm wrong or just don't understand something important. What do you think ?