During the Stalinist Era, Leon Trotsky was one of the biggest targets for Stalin’s paranoia. It even got to the point where people were getting purged merely for having formerly associated with him. With Stalin’s death and Khrushchev’s destalinization program, was Trotsky rehabilitated like many of Stalin’s victims? If so, would he have been talked about in Soviet history classes or would they just not mention him?
Leon Trotsky was in the bad books of the Soviet bureaucracy throughout most, if not all, of its existence, and was one of the only Marxists murdered by the Stalinist regime who was never rehabilitated by the Soviet government. This is primarily down to the fact that rather than simply being an opponent of Stalin - a serious crime all on its own in the Stalin-era - he was one of the first Marxists to put forward a systemic critique of the Soviet Union which he helped to create. And his was certainly the most prominent of those critiques.
Most of the Marxists who were rehabilitated by the Soviet government throughout its existence were usually Marxists of the "right wing" variety, akin to Nikolai Bukharin. These Marxists were often outright supportive of the Stalinist regime but still fell victim to it, or were more critics of Stalin and the role that he and his clique personally played, but still more or less thought the structures of the Soviet Union were sound.
Trotsky, on the other hand, put forward a scathing political analysis of not just Stalin, but the entire Soviet bureaucracy, and he built an entire international movement on the basis of that very critique. By the late 1930s, he was not just lambasting Stalin as a counter-revolutionary, but putting forward the argument that the entire bureaucratic apparatus of the Soviet Union needed to be overthrown because it was systemically incapable of providing the revolutionary and socialist leadership that the USSR required. This denunciation applied just as much to Gorbachev, Brezhnev and Khrushchev as it did to Stalin.
Even in the most liberal periods of the USSR, in the late 1980s, Trotsky was viewed by most as a de facto traitor, or at best a political hack and wannabe dictator. Gorbachev mentioned Trotsky in an official Soviet speech for the first time in decades, in 1987 - only to denounce him and glorify Stalin as a defender of genuine Leninism. In 1988, Soviet military historians such as Dmitri Volkogonov were writing about Trotsky in the party paper, Pravda, where he argued in favour of Trotsky's positive role in the Bolshevik Revolution up until 1925 - but otherwise discussed him in harshly critical terms and rejected the idea that he should be rehabilitated. But that Trotsky and his ideas were being mentioned at all marked an incredible opening up. Had the Soviet Union went on for a number of years more, Trotsky may well have been rehabilitated - he was only formally rehabilitated by the Russian Federation in 2001. So, to answer your question, Trotsky was pretty much always viewed - officially - as a traitor, or at best a completely wrong and misguided revolutionary leader.
In an unofficial sense, Trotsky's legacy of revolutionary communist opposition to the Stalinist regime was real but relatively minor. The naval mutiny of the Storozhevoy in 1975 was directly inspired by Trotsky's views on the need for a political revolution in the USSR in order to advance communism, but it was isolated due to some relatively poor planning from the mutineers. Considering how influential naval mutinies have been in kickstarting revolutionary uprisings in Russia, they might have dodged quite a large bullet in that regard.
However, one Trotsky that did get rehabilitated was Trotsky's son, Sedov (who was executed by the Stalinist regime in 1937), after Sedov's daughter (Yulia Akselrod) wrote to Gorbachev.