My favorite approach in finding counterexamples whenever I am not familiar enough with the mathematical object $M$ is a top down approach.
Start with the most general example of $M$, and the find the condition that all counterexamples of M has to violate, then pick one concrete counterexample from this set of counterexamples:
For this example, here, $M$ is "the matrices $A$, $B$ that satisfy the property stated in the OP"
For example consider matrices:
$$A=\begin{pmatrix}a&b\\c&d\end{pmatrix}, B=\begin{pmatrix}e&f\\g&h\end{pmatrix}$$
Then
$$A+B=\begin{pmatrix}a+e&b+f\\c+g&d+h\end{pmatrix}, AB=\begin{pmatrix}ae+bg&af+bh\\ce+dg&cf+dh\end{pmatrix}$$
Now the characteristic equations are (Either direct computation or using the nice property that for n=2 matrices, the $cp_A(x)=x^2-\text{tr}(A)+\det(A)$)
$$cp_A(x)=x^2-x(a+d)+(ad-bc)=0\\
cp_B(x)=x^2-x(e+h)+(eh-fg)=0\\
cp_{A+B}(x)=x^2-x(a+e+d+h)+((a+e)(d+h)-(b+f)(c+g))=0\\
cp_{AB}(x)=x^2-x(ae+bg+cf+dg)+((ae+bg)(cf+dh)-(af+bh)(ce+dg))=0$$
Therefore the quadratic formula said the eigenvalues are
$$
x_A=\frac{(a+d)\pm\sqrt{(a+d)^2-4(ad-bc)}}{2}\\
x_B=\frac{(e+h)\pm\sqrt{(e+h)^2-4(eh-fg)}}{2}\\
x_{A+B}=\frac{(a+e+d+h)\pm\sqrt{(a+e+d+h)^2-4((a+e)(d+h)-(b+f)(c+g))}}{2}\\
x_{AB}=\frac{(ae+bg+cf+dg)\pm\sqrt{(ae+bg+cf+dg)^2-4((ae+bg)(cf+dh)-(af+bh)(ce+dg))}}{2}$$
This looks very messy thus let's simply it using traces and determinants (Note: only feasible for n=2)
$$
x_A=\frac{\text{tr}(A)\pm\sqrt{(\text{tr}(A))^2-4\det(A))}}{2}\\
x_B=\frac{\text{tr}(B)\pm\sqrt{(\text{tr}(B))^2-4\det(B))}}{2}\\
x_{A+B}=\frac{\text{tr}(A+B)\pm\sqrt{(\text{tr}(A+B))^2-4\det(A+B))}}{2}\\
x_{AB}=\frac{\text{tr}(AB)\pm\sqrt{(\text{tr}(AB))^2-4\det(AB))}}{2}$$
Call the squreroot terms of $x_A$ and $x_B$, as $s_A$ and $s_B$ respectively to reduce the visual clutter on the next step
Now compute the sum and product of eigenvalues
$$x_A+x_B=\frac{\text{tr}(A)+\text{tr}(B)\pm s_A\pm s_B}{2}\\
x_Ax_B=\frac{\text{tr}(A)\text{tr}(B)\pm \text{tr}(A)s_B\pm \text{tr}(B)s_A\pm s_As_B}{4}$$
Now since $\text{tr}(A+B)=\text{tr}(A)+\text{tr}(B)$, comparing $x_A+x_B$ with $x_{A+B}$ shows that the trace of $A$ and $B$ is not what causes the counterexamples to be possible
This means the values a,d,e,h and the traces of $A$ and $B$ does not affect whether the matrices will satisfy the condition required by the counterexample. Thus we can set them all to zero to save ourselves some trouble (Thus we are just starting to pick a counterexample from the set of counterexamples for $M$)
So our equations reduces to
$$
x_A=\frac{\pm\sqrt{-4\det(A))}}{2}\\
x_B=\frac{\pm\sqrt{-4\det(B))}}{2}\\
x_{A+B}=\frac{\pm\sqrt{-4\det(A+B))}}{2}\\
x_{AB}=\frac{\text{tr}(AB)\pm\sqrt{(\text{tr}(AB))^2-4\det(AB))}}{2}$$
$$x_A+x_B=\frac{\pm \sqrt{-4\det(A))}\pm \sqrt{-4\det(B))}}{2}\\
x_Ax_B=\frac{\pm \sqrt{-4\det(A))}\sqrt{-4\det(B))}}{4}$$
$$AB=\begin{pmatrix}bg&0\\0&cf\end{pmatrix}\\
A+B=\begin{pmatrix}0&b+f\\c+g&0\end{pmatrix}$$
$$A=\begin{pmatrix}0&b\\c&0\end{pmatrix}, B=\begin{pmatrix}0&f\\g&0\end{pmatrix}$$
Now consider
$$\sqrt{(\text{tr}(AB))^2-4\det(AB))}=\sqrt{(bg+cf)^2-4bgcf}=\sqrt{(bg)^2+2bgcf+(cf)^2-4bgcf}=\sqrt{(bg-cf)^2}=\pm(bg-cf)$$
Thus giving
$$
x_A=\pm\sqrt{bc}\\
x_B=\pm\sqrt{fg}\\
x_{A+B}=\pm\sqrt{bc+bg+fc+fg}\\
x_{AB}=\frac{(bg+cf)\pm(bg-cf)}{2}=\text{bg or cf}$$
$$x_A+x_B=\pm \sqrt{bc}\pm \sqrt{fg}\\
x_Ax_B=\pm \sqrt{bc}\sqrt{fg}$$
Solving the equation in terms of $x_A$ and $x_B$
$$
x_A=\pm\sqrt{bc}\\
x_B=\pm\sqrt{fg}\\
x_{A+B}=\pm\sqrt{x_A^2+bg+fc+x_B^2}\\
x_{AB}=\frac{g}{c} x_A^2\text{ or }\frac{c}{g} x_B^2$$
$$x_A+x_B\\
x_Ax_B$$
So in order for $M$ to be true, that is
$$x_Ax_B\neq x_{AB}\\
x_A+x_B\neq x_{A+B}$$
you have
$$bg+fc\neq\pm2\sqrt{bc}\sqrt{fg}\\
fg\neq \frac{g^2b}{c}\text{ or }bc\neq 0$$
The equation above is underdetermined (4 unknowns with 2 equations), thus let's simplify it by assuming $f=g=1$ to obtain
$$b+c\neq 2\sqrt{bc}\\
b\neq c\text{ or }bc\neq 0$$
So there's a lot of possible choices here, let's choose $c=1$, therefore,
$$b+1\neq 2\sqrt{b}\Rightarrow (b+1)^2\neq 4b \Rightarrow b\neq 1\text{ or }0$$
So let's choose $b=2$
Therefore, ONE solution to $M$, that is the required counterexample is
$$A=\begin{pmatrix}0&2\\1&0\end{pmatrix}, B=\begin{pmatrix}0&1\\1&0\end{pmatrix}$$
$$A+B=\begin{pmatrix}0&3\\2&0\end{pmatrix}, AB=\begin{pmatrix}2&0\\0&1\end{pmatrix}$$
Here $A$ has eigenvalues $\sqrt{2}$ and $-\sqrt{2}$, $B$ has eigenvalues 1 and -1, while $A+B$ has eigenvalues $-\sqrt{6}$ and $\sqrt{6}$ and $AB$ has eigenvalues 2 or 1. It is then easy to check that no possible products or sums of eigenvalues of $A$ and $B$ matches at least one of those in $A+B$ and $AB$ (in fact, it turns out this particular counterexample, even the sum and products of eigenvalues in just $A$ or $B$ cannot equal to those of $A+B$ or $AB$ thus making it a pretty broken (hence almost perfect) counterexample.
Woa this is LONG!
Anyway here are the pros and cons of using this method
Pros
- After the calculation, not only you will get at least one counterexample (provided there actually exists one as some problems it turns out the counterexample set is empty), you will also understand how, in the fundamental level, it is a counterexample.
- This method guarantee to not only give you one counterexample, but it gives ALL possible counterexamples (or a subset of it) that is possible for the problem (in other words, the "solution set of counterexamples" to the given problem). It also tells you the constraint the elements has to satisfy to be a counterexample, thus deepen your understanding on the mathematical object in question, so that when similar problem arises, you can use that along with trial and error and other methods suggested by Qiaochu to roughly work out what direction you should head to find the counterexample. The constraint can then be modified slightly in order to find new counterexamples to a related problem or to explore the properties of more exotic mathematical objects where the usual rules don't apply
Cons
As you can see in this answer, exploring the "Space of Counterexamples" is in general a very tedious, inefficient, error prone and time consuming task, thus obviously this is not recommended in exam conditions (unless you can do algebra quickly or know the mathematical object well enough to take shortcuts). Therefore, it is best to treat this method as a last resort after all other method fails, unless you are interested in exploring the mathematical object thoroughly
It is often easy to get lost, misleaded and accidentally left mathematics when exploring the space of counterexamples, resulting in philosophical and possibly metaphysical questions like this one