Replace $\lim_{k\to\infty}\lim_{m\to\infty}f(k,m)$ and $\lim_{m\to\infty}\lim_{k\to\infty}f(k,m)$ by $\lim_{n\to\infty}f(n,n)$? 
When can we replace
  $\displaystyle\lim_{k\to\infty}\lim_{m\to\infty}f(k,m)$ and
  $\displaystyle\lim_{m\to\infty}\lim_{k\to\infty}f(k,m)$ by
  $\displaystyle\lim_{n\to\infty}f(n,n)$ ?

For the case $\displaystyle f(k,m)=\left(\frac{1}{k}\right)^{1/m}$ since its limit does not exist for it converging to $0$ or $1$, so it won't matter if we replace both $m$ and $k$ by $n$?
 A: Your statement "since its limit does not exist for it converging to 0 or 1," doesn't make any sense to me, so I'm going to skip over it. Both of the first two limits you've written down do exist for this particular function:
\begin{align}
\lim_{k\to\infty}\lim_{m\to\infty} \left(\frac{1}{k}\right)^{1/m} 
&= \lim_{k\to\infty} \left(\frac{1}{k}\right)^0 \\
&= \lim_{k\to\infty} 1 \\
&= 1
\end{align}
By contrast, 
\begin{align}
\lim_{m\to\infty}\lim_{k\to\infty} \left(\frac{1}{k}\right)^{1/m} 
&= \lim_{m\to\infty} \left(0\right)^{1/m} \\
&= \lim_{m\to\infty} 0 \\
&= 0
\end{align}
So this is a perfect example of when you cannot swap the order. And if you try the middle case (replacing $m$ and $k$ both with $n$), you'll again get $1$. 
In short ... this stuff's subtle, and if there were an easy rule like this, your textbook would probably have mentioned it. 
A: When does it work? As a general rule it doesn't. In the few cases where it does work, it does so only by accident.
Even for a function as nice, smooth and bounded as $f(k,m)=\tan^{-1}(k-m)$, we get
$$ \lim_{m\to\infty} \lim_{k\to\infty} f(k,m) = \pi/2 
\qquad \lim_{k\to\infty} \lim_{m\to\infty} f(k,m) = -\pi/2
\qquad \lim_{n\to\infty} f(n,n) = 0 $$ 
So essentially the only situation in which you can do this replacement is when you already know it will work because you have evaluated both limits and seen that they coincide.
