In Algebra (2) I was told that if a polynomial had an even multiplicity for some $x=a$, then the graph touches $y=0$ at $x=a$ but doesn't cross $y=0$. Odd multiplicities go through the $x$-intercept. For example:$$y=x^2\to y=(x-0)(x-0)\to x=0,0$$And you can clearly see the graph "touches without intersecting" at $x=0$.

However, I am confused on how this is proven.
['https://math.stackexchange.com/questions/1589095', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/272831/']
Let $P(x) = Q(x)(x-a)^{2n}$ such that $(x-a)\nmid Q(x)$. In a small enough neighbourhood of $a$ (for instance one that contains no roots of $Q(x)$), then $Q(x)$ preserves sign. And $(x-a)^{2n}\geq 0$, therefore, in said neighbourhood, $P(x)$ preserves sign, i.e., the function does not cross the line $y=0$.

You can find a similar argument of why it happens the other way around for $P(x) = Q(x)(x-a)^{2n+1}$.
Suppose you have $f(x) = (x+6)(x-4)(x-7)^2$. If $x$ is near $7$ then $(x+6)(x-4)$ is near $(7+6)(7-4) =39$, so $f(x)$ is approximately $39(x-7)^2$. Notice that if $x$ is either a little bit more than $7$ or a little bit less, then $(x-7)^2$ is positive, but if $x$ is exactly $7$, then $(x-7)^2$ is $0$. Being positive on either side of that point but exactly $0$ at that point means it touches the axis without crossing over from positive to negative or vice-versa.