This means that, at the end of the output layer, we must have the actual values of the target function anyway.
Yes, this is necessary for supervised learning. You will often see this called a labelled dataset, where the "label" is an output value that you know is associated with each input. A set of labels associated with some inputs, that you have collected for training may also the called the "ground truth".
We do not need all possible values though, but enough examples that the neural network can interpolate between them. How many examples that is depends on the complexity of the function we want to learn.
So what problem does the neural network really solve?
There are three main things it solves, and these are shared with most other machine learning approaches:
The neural network learns a function from examples of input and output.
The neural network will learn an expected value (or for classifiers, a probability distribution) when trained using noisy or stochastic data.
The neural network makes few assumptions about the relationship between input and output, and can learn successfully even for quite complex relationships.
These traits are all useful when you do not have a strong sense of what the correct function should be, in terms of writing an equation, but do have many examples of it.
What about when we choose a value of dosage which has not been observed, for example, 0.25?
The neural network will still produce an output. In a very simple scenario, where you had trained with example inputs at e.g. 0.2 and 0.3, then the output will likely be somewhere between the outputs for those two values. For a neural network, this in-between value can be much more sophisticated than a simple mean of the nearest examples. ML that uses the nearest values exists, that is called k-nearest neighbours.
If this process has worked well, and the trained neural network produces useful, accurate predictions from unseen inputs, it is said to generalise well. Very often, that is the goal for training a neural network or other machine learning system.
It is worth mentioning some additional facts and features of training neural networks (and ML in general):
When generalisation is the goal (and it often is), then you need to test for it. This is done by keeping some example data back, not using it to train, but instead using it to check results on unseen inputs. In fact, this is so important, the data is often split into three sets - a training set, a cross-validation (aka development) set, and a test set.
The lack of assumptions in the basic model can lead to needing many training examples. If you know something specific or useful about the function being learned, you can pre-process the inputs to help - this is called feature engineering.
Machine learning can be good at interpolation, i.e. calculating outputs for inputs that are not in the original training data, when the unseen inputs are in-between or close to the training examples. Even when good at interpolation, it will still be bad at extrapolating to new unseen inputs that are outside of the ranges of the training examples. That is because it has used a very general/flexible system to fit some line or curve to examples, it has not learned an analytical function.
Exceptions to all of these points exist. They are the norm, but it will depend on the details of what you are trying to do.