He had recently traveled to Libya to see his parents. The authorities are scrambling to learn how he became involved with extremism.