Alternatives to linear activation function in regression tasks to limit the output
Don't use that activation function shown in the question.  It doesn't do what you think it does.  Instead:

If you want the output to be in the range $[-1,1]$, you can use a sigmoid or tanh activation function in the final layer.

If you want the output to be in the range $[-100,100]$, do the same, then multiply the final output by 100 (a hardcoded constant).

If you want the output to be in the range $[-50,150]$, do the same, then multiply the final output by 100, then add 50.

Hopefully you can now see how to handle any desired range.



After some edits, I see some misconceptions in your question:


Contrary to what you write, there is no reason that the last layer of a regression model has to use a linear activation function.  It's not like there are "regression police" who are going to arrest you for using a different activation function.

You say it is customary to use a linear function at the output of a regression model.  That's not really because those models are doing regression; rather, that's more because they are solving a task where you want range of possible outputs to be $[-\infty,+\infty]$, so of course they're not going to use an activation function that restricts the range.  Now you have a new setting where you do want to restrict the output range -- so it is reasonable to use a different activation function.  You're have a non-customary regression task, so don't be surprised if this means you might benefit from an activation function that is non-customary.
Sigmoid and tanh have been used in other contexts because they do have other useful properties, but that doesn't mean they're not also useful here.  An activation function can have multiple useful properties, some of which are relevant in one setting and some of which are relevant in another.


Sigmoid (also called softmax) is often used in classification partly because in classification we want the output to be in the range $[0,1]$, so it is natural to pick an activation function that ensures that range; and partly because there are some statistical reasons to choose sigmoid (aka softmax).  The former is relevant here; the latter is not.  You're allowed to use the sigmoid function for your task for a different reason than why people use sigmoid for classification.
It's true that some sources have used tanh because of its derivatives, but that doesn't mean it's the only allowed reason to use tanh.  You're allowed to use tanh because of the way it restricts the output range rather than because of properties of its derivatives.

Contrary to what you wrote, sigmoid can be used at the last layer of regression tasks.


Ultimately, I think you are prematurely rejecting plausible approaches without a good reason for doing so.

It's also possible to experiment with approaches where you penalize outputs that are outside the range, instead of changing the last-layer activation function.  Indeed, as long as all outputs in the training set are in-range, a standard loss function (like squared loss) will already do that.  However, it's hard to say how well that will work, or whether it will work better than a clever choice of activation function for the last layer.  The only way to find out is to try it and see.