Non trainable problems
In this discussion, it is described how a neural network that distinguishes odd and even numbers can be constructed.
Your question can be rephrased more generally: Is there a function that cannot be learned by a machine learning algorithm. This question was discussed here and here. Both discussions refer to the Universal Approximation Theorem that basically states that any computable function on a given finite range can be approximated by a neural network. So, what is left is uncomputable functions or undecidable problems. These cannot be learned by a machine-learning algorithm.