Sort an array by value and index in C
Well, your code works, though it needs \$O(n)\$ space and \$O(n^2)\$ time.

It's also quite cleanly implemented, so kudos.

Still, there's naturally something which can be improved:


If you need a generic loop-index, the natural name is i. If you need a second one, ask for j. Yes, they are short, but they are the standard names, so you cannot get more descriptive.
Your additional array's name should reflect its use: Call it keys.
You have a general tendency for long names. Try to keep it as brief as you can without sacrificing clarity.
Avoid using a type with sizeof. If the receiving variable ever changes its type, you have to keep it in sync manually, and its not idiomatic. Use:

int* keys = malloc(arrayLength * sizeof *keys);

You assume that malloc() won't fail. You know assume makes an ass out of u and me?
Do you know that signed integer-overflow is Undefined Behavior? I didn't find anywhere in the problem-description a guarantee that array[i] * (i + 1) won't overflow, so you might want to use a bigger type for the keys.
Should you really write your own sub-standard sorting-algorithm, or can you use the one in the standard-library?


The following trades more extra-space for using qsort(), which should have \$O(n * \log(n))\$ runtime:

typedef struct pair {
    long long key;
    int value;
} pair;

static int sortByValueAndIndex_comp(const void* pa, const void* pb) {
    long long a = ((pair*)pa)-&gt;key;
    long long b = ((pair*)pb)-&gt;key;
    return (a &gt; b) - (a &lt; b);
}

int* sortByValueAndIndex(int* arr, int n) {
    assert(arr || !n);
    assert(INT_MAX &lt;= LLONG_MAX / INT_MAX);
    pair* kv = malloc(n * sizeof *kv);
    if (!kv)
        return 0;

    for (int i = n; i-- &gt; 0;) {
        kv[i].key = arr[i] * (i + 1LL);
        kv[i].value = arr[i];
    }

    qsort(kv, n, sizeof *kv, sortByValueAndIndex_comp);

    for (int i = n; i-- &gt; 0;)
        arr[i] = kv[i].value;

    free(kv);
    return arr;
}