Android netrunner: may I trash a card before I am forced to discard?
No because, unlike magic, Netrunner doesn't have a stack. Situations resolve in order the based on who's turn it is. If the corp spends a click to trash your resource you cannot "as a response" trash the resource for its ability. It is the corps turn so their click goes through first and by the time a paid ability window gets around for you to use the ability your resource is already gone.

Edit: As Andrew mentioned in the comments, there is one exception to this. Cards that have prevent or avoid as a "keyword" (most of these are related to damage and/or tags) CAN be used as a response.