Is there a hashing function $f$ that for each input $x$ if $f(x) = y$, then $f(x \, || \, y) = y$? In other words, if we concatenate its output with the input, the result will not change.
Furthermore, is there a simple construction for such functions?
Example
Let $x =$ "hello" and $f(x) =$ "123". Then $f($"hello123"$) =$ "123".
While on existing hashing algorithms the question of finding the $y$s is clearly hard, it is easy to create hashing functions with a known fixed point (see this answer). This problem is a simple generalization of the fixed point problem, which gives me hope that it is also not much harder.
If security of $f$s is incompatible with the desired property, then how about an $f$ that at least have the uniform $y$ distribution?
Applications
Hashes of files often serve as "links" to them. Some files can link to other files, and this way loops may come up. The requested hashing functions should be able to handle the loops, whereas common hashing algorithms cannot.