When is $\phi(n)=n$ true? For what values of n is $\phi(n)=n$ true? Just looking at tables of values it seems that $\phi(n)=n$ is true only for $n=0,1$ but I cannot come up with how to  prove this.

I realize that the value of $\phi(0)$ is not really well-defined (What is the Euler Totient of Zero?) but for the purpose of this question I'll assume it is.
First, $\varphi(n)$  is defined only for $n\ge 1$. Second, if $n=\prod\limits_{i=1}^r p_i^{r_i}$  for primes $p_1,\dots,p_r$, we have:
$$\frac{\varphi(n)}n=\prod_{i=1}^r\Bigl(1-\frac1p_i\Bigr).$$
Thus, $\varphi(n)=n\iff\dfrac{\varphi(n)}n=1$ can be true if and only if $r=0$, i. e. $n=1$.
By definition, $\phi(n)&lt;n$ for $n\ge 2$ since, $(n,n)=n$.