The riddle that Goren mentions in the psychiatrist's office is solved by asking either guard which door the other guard would tell you to enter, and then doing the opposite. The one who always tells the truth will tell you that the one who always lies would tell you to enter the door to hell, since that would be his lie. The one who always lies would falsely tell you the one who tells the truth would point you towards the same door, meaning you shouldn't believe him and should pick the opposite door.
The answer to the riddle presented in this episode is given in the last episode of this season, "To the Boy in the Blue Knit Cap," which is the final episode of the "Law & Order:Criminal Intent" series. It occurs in the next to the last scene of that episode.