Interesting thing about sum of squares of prime factors of $27$ and $16$.
For two factors $$f(pq)=p^2+q^2\gt pq$$ so $pq$ is not a solution.
For three factors: If $3$ is a factor then $3^2+p^2+q^2$ is only a multiple of $3$ if $p=q=3$ as well. If $3$ is not a factor then $p^2=q^2=r^2=1\pmod3$, so the sum is a multiple of $3$, and $pqr$ is not a solution. So $27$ is the only solution with three factors.
For four factors, they can't all be odd as the sum would be even. Then there must be an even number of odd factors. So it is a multiple of $4$, and looking $\pmod4$, the factors are either all odd or all even. So $16$ is the only solution with exactly four factors.
For five factors, I think they must all be odd; so $n=5\pmod8$.
For six factors, two of them must be 2, three must be 3, leaving $35+p^2=108p$ which has no solution.
For eight factors, all of them must be even, but $256$ doesn't work so there is no solution.
Edit:
Good news, bad news.
Good news: $$3^2+3^2+5^2+1979^2+89011^2\\=3×3×5×1979×89011$$
Bad news: $89011$ is not prime.
My idea was that the equation is a quadratic in the final prime. The quadratic's discriminant must be a perfect square, and that is a Pellian equation in the second-last prime. If the other primes are $3,3,5$, this Pellian has solutions $$1,44,1979,89011,...$$ with $$a_{n+1}=45a_n-a_{n-1}$$
If two consecutive terms are prime, then I think $3×3×5×a_n×a_{n+1}$ is a solution to the current problem
EDIT: Let $$\alpha=\frac12(\sqrt{47}+\sqrt{43}),\beta=\frac12(\sqrt{47}-\sqrt{43})\\ A = \frac1{\sqrt{47}}(\alpha^{107}+\beta^{107}),B=\frac1{\sqrt{47}}(\alpha^{109}+\beta^{109})$$ $A$ and $B$ are consecutive terms from the sequence in the previous edit. Maple confirms that $A$ and $B$ are prime, and $$3\times3\times5\times A \times B=3^2+3^2+5^2+A^2+B^2$$
Just some ideas, maybe useful to obtain a proof.
Let's focus on integers of the form $p^k$, where $\,p\,$ is prime. If $p^k$ satisfies the request, then $$f(p^k)=kp^2=p^k$$ $$k=p^{k-2}\;\;\;\;\;\;\;(1)$$ So $\,p\,$ divides $\,k\,$ and it's easy to see that the only solutions of $\,(1)\,$ are $\,(k,p)=(3,3)\,$ and $\,(k,p)=(4,2)$. More precisely (as requested by Peter), exists a certain $\,\alpha$ such that: $$k=p^\alpha=p^{(p^\alpha -2)}$$ $$\alpha=p^\alpha -2$$ $$\alpha+2=p^\alpha\ge2^\alpha\;\;\;\;\;\;\;(2)$$ and the only solutions of $\,(2)\,$ are indeed $\,\alpha=1\,$ and $\,\alpha=2$.
Further, if $\,q\cdot p^k$ (with $\,q\,$ prime different from $\,p$) satisfies the request, then $$f(q\cdot p^k)=f(p^k)+q^2=q\cdot p^k\;\;\;\;\;\;\;(3)$$ From $\,(3)\,$ we see that necessarily $\,q\,$ has to divide $\,f(p^k)$.