1) the set of diagonal matrices is path connected: if $A=\sum a_j E_{jj}$, $B=\sum b_j E_{jj}$ we take the map $t\mapsto \sum (ta_j+(1-t)b_j) E_{jj}$, $t\in[0,1]$.
2) The set of unitaries is path connected. If $U,V$ are two unitaries, we can always write them as $U=e^{iA}$, $V=e^{iB}$ with $A,B$ hermitian. Then we can consider the map $t\mapsto e^{itA}e^{i(1-t)B}$, $t\in[0,1]$ which gives a path from $U$ to $V$ within the unitary group.
3) The set of invertible hermitian matrices with positive eigenvalues is path connected. If $A,B$ are like that, then $A=UD_AU^*$, $B=VD_BV^*$. By parts 1) and 2), there exist continuous $f,g:[0,1]\to M_n(\mathbb{C})$ with $f(0)=D_A$, $f(1)=D_B$, $g(0)=U$, $g(1)=V$. Then $t\mapsto g(t)f(t)g(t)^*$ is continuous and takes $A$ to $B$. Note that the way that $f$ is defined guarantees that $f(t)$ will have positive eigenvalues for all $t\in[0,1]$.
4) GL$_n(\mathbb{C})$ is connected: Given $A,B$ invertible, we can write them as $A=RU$, $B=SV$ with $R,S$ hermitian and positive, and $U,V$ unitaries. By 3) and 2) we can find continuous functions $f,g:[0,1]\to M_n(\mathbb{C})$ with $f(0)=R$, $f(1)=S$, $g(0)=U$, $g(1)=V$. Then the map $t\mapsto f(t)g(t)$ is a continuous path from $A$ to $B$ (note that $f(t)$ and $g(t)$ are invertible for every $t\in[0,1]$ and then so is their product).
It only remains to justify the polar decomposition $A=RU$. An easy way to see this is by using the singular value decomposition. We write $A=WDV$, with $W,V$ unitaries and $D$ diagonal with non-negative entries (positive if $A$ is invertible). Then we can write
$$
A=(WDW^*)WV=RU,
$$
where $R=UDU^*$ is hermitian with positive eigenvalues (because $D$ is), and $U=WV$ is a unitary.
Hint : Here I have done for $2 \times 2$ matrix.
Let $A = \left(
\begin{array}{cc}
a & 0 \\
0 & b \\
\end{array}
\right)$
be a diagonal matrix with complex entries. Its eigenvalues
are precisely $a$, $b$. Because $A$ is Hermitian, they must be real. Also $A$
is unitary, they must each be of absolute value $1$. There are exactly four
matrices satisfying these conditions:
Let $A_1 = \left(
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right)$, $A_2 = \left(
\begin{array}{cc}
1 & 0 \\
0 & -1 \\
\end{array}
\right)$, $A_3 = \left(
\begin{array}{cc}
-1 & 0 \\
0 & 1 \\
\end{array}
\right)$, $A_4 = \left(
\begin{array}{cc}
-1 & 0 \\
0 & -1 \\
\end{array}
\right)$
I hope this may help you.
Best Answer
Not always. Consider $$ A=x=\pmatrix{1\\ &2}\quad\text{and}\quad y=\pmatrix{2\\ &1}. $$ Since $A$ is a diagonal matrix with distinct diagonal elements, if $AU=UA$, then $U$ must be a diagonal matrix. Hence $U$ commutes with both $x$ and $y$. But then the equation $xU=Uy$ implies $(x-y)U=0$. Since $x-y$ is nonsingular, $U$ is necessarily zero.