I think this code is only simple math, but I'm posting it, because almost everyone fakes the scaling with unparenting, then parenting again.
Vector3 originalParentScale = new Vector3;
Vector3 originalScale = new Vector3;
void Awake(){
originalScale = transform.localScale;
originalParentScale = transform.parent.localScale;
}
void Update(){
transform.localScale = (originalParentScale / transform.parent.localScale) * originalScale;
}
I think it can be even improved, so I would be happy if someone can improve it. It's challenge too, so happy programming :-)