#!/bin/bash
s="Text... f[3][2,3][4] ...text"
sed -E 's/(f\[[0-9]*]\[[0-9]*,[0-9]*])\[([0-9]*)]/\1["string"][\2]/g' <<< "$s"