Investigators said they were unsure of the attacker’s motives. But clues pointed to an isolated and increasingly troubled life, and no accomplices.