How are proofs formatted when the answer is a counterexample?

I would say something along the lines of:

The proposed result is false. Here is a counterexample...


In these cases on my homework when I type it up, I just change the statement of the theorem to match what is true. Given that problem on my homework I would write

$\textbf{Theorem:}$ It is not necessarily the case that the sum of two integers is odd.

$\textbf{Proof:}$ Observe that $1+1=2$. Since $1$ is an integer and $2$ is not odd, we have proved the result.$\blacksquare$


Prove or find a counterexample: the sum of two integers is odd.

The above statement is not true and a counterexample can be easily found. It suffices to check the first few positive integers to discover that $1+1=2$.

I think the idea is that since it's not a Proof you shouldn't precede the statement of the counterexample with the word "Proof" like usual. The statement of the counterexample can be viewed just as commentary, and can be formatted as such. Of course the best way to format commentary depends on the context (academic paper, homework, etc).

In general, though, you don't need to worry so much about stuff like this. Always remember that the purpose of writing is to clearly communicate an idea to a reader. Don't stress over a correct way to format your writing. Just worry about your formatting making the meaning of your message clear.