What happens if I think that my answer is more valid than the accepted one? I don't know if this is my perception, or, effectively, my answer is better. What should I do?
It's up to the person who asked to determine the best answer, and many times the person never comes back to check to see if newer answers get better.
I wouldn't worry about it, the community will vote the good answers to the top and I would think that most people reading a question will look at a few of the answers instead of quitting at the first one, many times all the top answers answer the question as a whole instead of one dogmatic "proper" answer.
Usually, nothing. If the other answer is flat out wrong, downvote it and leave a comment explaining why. You can also leave a comment for the OP informing them of why it's wrong.
If the other answer is just less correct than yours but not wrong, do nothing. The OP is free to accept whichever answer they prefer. If your answer is considered better by the community, it will get more upvotes. There's even a badge for that:
Populist: Highest scoring answer that outscored an accepted answer with score of more than 10 by more than 2x. This badge can be awarded multiple times.
Short answer: nothing. It's up to OP to choose which answer to mark as the accepted answer.
But this doesn't imply that such answer is the best.
First of all because being objective, the choice of the accepted answer it's just up to OP's opinion. People sometimes make mistakes and sometimes don't have enough expertise to correctly determine whether an answer is better than another.
Furthermore, when you hover the mouse over the acceptance mark on an answer on your question, this is the text that actually pops up:
Click to accept this answer because it solved your problem or was the most helpful in finding your solution (click again to undo)
This means that marking an answer as accepted either means that:
- The answer solved the problem
- The answer was the most helpful in finding the solution
And this doesn't imply that such answer is the best.
Upvotes, instead, are a way more democratic way for everyone to express an opinion, and could be a pseudo-valid criterium to determine which answers are better and which answers are worse (I won't digress on why this isn't always true, there are lots of cases. I think you have got the idea).
If you feel the answer could be improved, drop a comment to the author suggesting that they do so, if the author is unwilling or unable to apply the improvements, You can offer to do so for them. The end result will be a better answer that's easier to find for those seeking solutions. Of course this approach is unlikely to boost your rep but it will improve the site (which is why your here, right?)