Let us look at the specific case of two mathmajors. There are the following three possibilities:
$\{m,f\},\{m,m\},\{f,f\}$
Of these, only the one outcome would make the phrase "All math majors are male" true, namely where it was $\{m,m\}$. On the other hand, both of the phrases $\{m,f\}$ and $\{f,f\}$ would make the phrase "All math majors are male" false.
When we negate a proposition, all outcomes which formerly were true will now be false and all outcomes which were formerly false will now be true. In other words, the negation of the statement should have both $\{m,f\}$ and $\{f,f\}$ return true. With this in mind, you should recognize that "All math majors are female" would leave $\{m,f\}$ as still a false statement, implying that it is not the correct negation.
In general, try to think of whether the proposition is worded as an existential or as a universal statement. The negation of universal statements become existential and vice versa.
$\forall x, P(x)$ is negated to be $\exists x, \neg P(x)$. Your "all math majors are women" mistake is as though you negated $\forall x, P(x)$ as $\forall x, \neg P(x)$ instead.
Longer statements with multiple quantifiers can be more exotic, but still follow similar rules.
(definition of $f(x)$ is continuous at $c$)
$\forall \epsilon>0, \exists \delta>0, \forall x(|x-c|<\delta\Rightarrow |f(x)-f(c)|<\epsilon)$
(negation of the above, i.e. $f(x)$ is not continuous at $c$)
$\exists \epsilon >0, \forall \delta>0, \exists x (|x-c|<\delta~\wedge~|f(x)-f(c)|\geq \epsilon)$
Your second example, $4+x=13$, it is unclear whether the statement is intended to be read as $\forall x, 4+x=13$ (a false statement), $\exists x, 4+x=13$ (a true statement), or simply as $4+x=13$ (a conditional statement which is either true or false depending on the specific value of $x$). Without more context, it should be assumed to be the third.
The negation of $\forall x, 4+x=13$ is $\exists x, 4+x\neq 13$
The negation of $\exists x, 4+x=13$ is $\forall x, 4+x\neq 13$
The negation of $4+x=13$ is $4+x\neq 13$
Note that all values of $x$ which made $4+x=13$ true make its negation false and all values of $x$ which made $4+x=13$ false will make its negation true.