Eating unhealthy foods early in life can have lasting effects on the brain, according to new Irish research.