Feature scaling worsens performance?
By scaling X but not y, and having small weights at initialization, I think you are making it hard for the NN to bring the weights up to the scale they need to be.  Possibly if you let it train for more epochs it would find the right scale, but quick experimentation suggests it gets stuck into an oscillating loss that is quite large.
I had success in reaching a parabolic curve by either (1) scaling y as well, to land roughly in $[0,1]$, or (2) setting the initial weights to be larger, e.g. from keras import initializers; nn_initializer=initializers.RandomNormal(std=0.5) and using kernel_initializer=nn_initializer throughout.  (The default for std in RandomNormal is 0.05).
For the indicator function target, obviously scaling y isn't the issue.  But interestingly, scaling up the initial weights does work.  Maybe because you need to get those two large-slope bits at 40 and 60?
One other thing I'd suggest trying (I haven't here) is varying the learning rate, dependent on the scale of things.  Especially when the initial weights are far below what we know they'll need to end up as, maybe a large initial learning rate with some decay would help.