What aircraft is this, when was it produced, used operationally, and what was its role?
It is a Tu-128.
In particular it seems to be the "UT" (training) variant:
Full-scale production of the aircraft began in 1966, with 188 Tu-128s built to 1970, that total apparently including the prototype. Ten "Tu-128UT" trainers were built as well, with a new cockpit for a flight instructor fitted into a swollen nose.
Other info on wikipedia
The Tupolev Tu-28 (NATO reporting name Fiddler) was a long-range interceptor aircraft introduced by the Soviet Union in the 1960s. The official designation was Tu-128, but this designation was less commonly used in the West.
The Tu-128's only publicly reported combat operation was the destruction of NATO reconnaissance balloons. The aircraft remained in service until 1990.