If $$n=p_1^{a_1}\cdots p_k^{a_k},$$ then define
$$f(n):=p_1^2+\cdots+p_k^2$$
So, $f(n)$ is the sum of the squares of the prime divisors of $n$.
For which natural numbers $n\ge 2$ do we have $f(n)=n$ ?
It is clear that $f(n)=n$ is true for the square of any prime, but false for the other prime powers.
If $p$ and $q$ are the only prime divisors of $n$, we would get $p^2+q^2\equiv 0\pmod p$, which implies $p=q$, so for numbers with exact two prime divisors, $f(n)=n$ cannot hold.
If $p,q,r$ are primes with $p<q<r$, then we have two possibilities.
If $p,q,r\ne 3$, we have $p^2+q^2+r^2\equiv 0\pmod3$, so $f(n)=n$ cannot hold. If $p=3$ or $q=3$, then $p^2+q^2+r^2 \equiv 2\pmod3$, so $p^2+q^2+r^2$ is not divisible by $3$, so $f(n)=n$ cannot hold.
Finally, if $p<q<r<s$, then if $p>2$, then $p^2+q^2+r^2+s^2\equiv 0\pmod4$, so $f(n)=n$ cannot hold. And if $p=2$, then $p^2+q^2+r^2+s^2\equiv 3\pmod4$, so $p^2+q^2+r^2+s^2$ is odd and $f(n)=n$ again cannot hold.
So, apart from the squares of the primes, the number must have at least $5$ prime factors. I searched to about $6\times 10^7$ and did not find a "non-trivial" example.
- Is there a number $n$ with at least two prime factors and $f(n)=n$ ?

It's not a full answer, just remarks
$a_k=1$ (as stated by Awllower)
$a_{k-1} = 1$
$k$ can't be even (obvious)
As stated by Peter $k$ can't be 3, and for the same reason $k$ can't be a multiple of 3, and for the same reason if $k=3x+2$ then 3 can't be a factor of $n$.
set $x=k$
we have $x*p_k^2>n$
<=> $x*p_k>\prod_{i=1}^{k-1} p_i^{a_i}$
<=> $x*p_k/\prod_{i=1}^{k-2} p_i^{a_i}>p_{k-1}$
so $p_k^2+(k-1)*(x*p_k/\prod_{i=1}^{k-2}p_i^{a_i})^2>n$
<=> $p_k^2*(1+(k-1)*(x/\prod_{i=1}^{k-2}p_i^{a_i})^2)>n$
Now if we try to get the lowest value for $x$, the limite is :
$x=1+(k-1)*(x/\prod_{i=1}^{k-2} p_i^{a_i})^2$
<=> $x={\prod_{i=1}^{k-2}p_i^{a_i}*(\prod_{i=1}^{k-2}p_i^{a_i}-\sqrt{(\prod_{i=1}^{k-2}p_i^{a_i})^2-4(k-1)})\over2(k-1)}$
numerical evaluation of $x$ for $k=5$ and $\prod_{i=1}^{k-2}p_i^{a_i}=2*5*7$ gives $x<1,0008177$
Hope it can help.