Let us write the following propositions:
$F_g$ means Fred is guilty, and $F_i$ means Fred is innocent, $T_g$ and $T_i$ for Ted and $E_g$ and $E_i$ for Ed.
- Ed says: $F_g \wedge T_i$
- Fred says: $E_g \rightarrow T_g$
- Ted says: $T_i \wedge (F_g \vee E_g)$
We know that the guilty is lying and the innocent tells the truth.
Assume Fred did it, he is guilty and lying. Meaning $E_g \rightarrow T_g$ is false, meaning $E_g$ is true and $T_g$ is false, that is Ed is guilty and Ted is innocent.
In turn it means that Ed is also lying, that is either Fred is innocent or Ted is guilty. If Fred is innocent then he is telling the truth - contradiction.
Therefore we know that Ted is guilty as well, another contradiction because it follows from Fred's lie that Ted is innocent.
Alright, then we have that Fred is definitely not guilty. So either Ed is innocent or Ted is guilty.
Assume that Ed is innocent, this is a right out contradiction, as this implies Fred is guilty. So we have that Ed has to be guilty, which means Ted is also guilty - therefore he is lying. Which means he either guilty or both the other guys are innocent. Since he is guilty we have a good solution:
Fred is innocent, Ted and Ed are guilty.