You're returning a pointer to a local variable, which results in undefined behaviour.
The most common way to deal with functions that return arrays is to pass in the array from the caller, e.g. fixed version of your code:
void func(int arr[]);
int main()
{
int arr[10];
func(arr);
for (int i = 0; i < 10; i++)
printf("%d ", arr[i]);
return 0;
}
void func(int arr[])
{
for (int i = 0; i < 10; i++)
arr[i] = i + 1;
}