How to train f(x)=x*x using Artificial neural network? let's take some training data of size 100

x_input = [1,2,3,4,.....,100]
y_label = [1,4,9,16,....,10000]

Now, let's consider that we don't know the function f where f(x_input) = x_input2
How should we train it?
The answer to your question lies here.

Personally, since I can see the high autocorrelation of your input signal x (obvious that x(t+1) = x(t) + 1), you could treat it as timeseries and use an LSTM-RNN to model the nonlinear function y. For simplicity, you could always treat your data as iid and, under this assumption, use an MLP.