Is it okay to use the same user group for testing in a regression model In my case, there are around 500 users who repeat a task for 3 times. I wonder if it is acceptable to train a model using the data from the first 2 tasks, and then test the trained model using the data from the 3rd task? Would this be a valid approach? Or, would it be more acceptable if I combine and shuffle the whole data and create train set and test set?
 A: For your first approach, it depends upon what succession the task is performed and thus eventually what the task is all about. Say if they are doing it repeatedly, then they would have gained some insights into how to perform the task better. In such a case the distribution of user data for the three sets will be different from each other (don't know much about the task that they are actually performing, it would be better if you could give a bit of idea on this).
That being said, mixing the data from the three repetitions and then jumbling it to create your train and validation set sounds a much better idea as the noise or the reduction of it for future repetitions is mixed now.
A: I do not disagree with @saha-rudra 's answer, but I would like to highlight the advantage of using the other method @renakre proposes. 
First some more on the random split method. If you use a random split of train and test sets, you build one model in the train set which fits to this data. As @saha-rudra suggests this might reduce noise. As the split into train and test sets was random, aside from (some) random error, it does not surprise me if the model's performance is about equal in the two datasets. To me, this would be a (low-level) internal validation of your model (all other model building problems such as overfitting aside). 
However, if we assume the three tasks each are a different setting of a similar problem (meaning one model might be applicable, but the tasks account for some variance), splitting the data according to the tasks ensures the training set is different from the testing set, allowing for nonrandom variation. Now, if your model, which was trained on task one and two data also performs well in the test set of task three data, this would suggest you actually found some associations which have a higher probability of being generalizable to new data on this problem. So, if you build a model in your training set (containing task 1 and 2) and check its performance in a non-random split test set (containing task 3 only), you are basically doing an external validation. 
In short, both methods have their merits, and as in most situations, you have to be clear about what you are trying to achieve: a model fitting your data as best as you can find in that data, or a model which fits your data and has a good chance of fitting other ("unseen") data as well.
